flair.trainers.plugins.TensorboardLogger#

class flair.trainers.plugins.TensorboardLogger(log_dir=None, comment='', tracked_metrics=())View on GitHub#

Bases: TrainerPlugin

Plugin that takes care of tensorboard logging.

__init__(log_dir=None, comment='', tracked_metrics=())View on GitHub#

Initializes the TensorboardLogger.

Parameters:
  • log_dir – Directory into which tensorboard log files will be written

  • comment – The comment to specify Comment log_dir suffix appended to the default log_dir. If log_dir is assigned, this argument has no effect.

  • tracked_metrics – List of tuples that specify which metrics (in addition to the main_score) shall be plotted in tensorboard, could be [(“macro avg”, ‘f1-score’), (“macro avg”, ‘precision’)] for example

Methods

__init__([log_dir, comment, tracked_metrics])

Initializes the TensorboardLogger.

attach_to(pluggable)

Attach this plugin to a Pluggable.

detach()

Detach a plugin from the Pluggable it is attached to.

get_state()

hook([first_arg])

Convience function for BasePlugin.mark_func_as_hook).

mark_func_as_hook(func, *events)

Mark method as a hook triggered by the Pluggable.

metric_recorded(record)

Attributes

attach_to_all_processes

If set, the plugin will be attached to all processes when distributed, not just the main process.

corpus

model

pluggable

trainer

metric_recorded(record)View on GitHub#
property attach_to_all_processes: bool#

If set, the plugin will be attached to all processes when distributed, not just the main process.

get_state()View on GitHub#
Return type:

dict[str, Any]