flair.trainers.plugins.MetricHistoryPlugin#

class flair.trainers.plugins.MetricHistoryPlugin(metrics_to_collect={('dev', 'loss'): 'dev_loss_history', ('dev', 'score'): 'dev_score_history', ('train', 'loss'): 'train_loss_history'})View on GitHub#

Bases: TrainerPlugin

__init__(metrics_to_collect={('dev', 'loss'): 'dev_loss_history', ('dev', 'score'): 'dev_score_history', ('train', 'loss'): 'train_loss_history'})View on GitHub#

Initialize the base plugin.

Methods

__init__([metrics_to_collect])

Initialize the base plugin.

after_training(**kw)

Returns metric history.

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#
after_training(**kw)View on GitHub#

Returns metric history.

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]