flair.trainers.plugins.DeepNCMPlugin#

class flair.trainers.plugins.DeepNCMPluginView on GitHub#

Bases: TrainerPlugin

Plugin for training DeepNCMClassifier.

Handles both multitask and single-task scenarios.

__init__()View on GitHub#

Initialize the base plugin.

Methods

__init__()

Initialize the base plugin.

after_training_batch(**kwargs)

Update prototypes after each training batch.

after_training_epoch(**kwargs)

Reset class counts after each training epoch.

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.

Attributes

attach_to_all_processes

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

corpus

decoders

Iterator over all DeepNCMDecoder decoders in the trainer.

model

pluggable

trainer

property decoders: Iterable[DeepNCMDecoder]#

Iterator over all DeepNCMDecoder decoders in the trainer.

after_training_epoch(**kwargs)View on GitHub#

Reset class counts after each training epoch.

after_training_batch(**kwargs)View on GitHub#

Update prototypes after each training batch.