flair.trainers.plugins.CheckpointPlugin#
- class flair.trainers.plugins.CheckpointPlugin(save_model_each_k_epochs, save_optimizer_state, base_path)View on GitHub#
Bases:
TrainerPlugin
- __init__(save_model_each_k_epochs, save_optimizer_state, base_path)View on GitHub#
Initialize the base plugin.
Methods
__init__
(save_model_each_k_epochs, ...)Initialize the base plugin.
after_training_epoch
(epoch, **kw)Saves the model each k epochs.
attach_to
(pluggable)Attach this plugin to a Pluggable.
detach
()Detach a plugin from the Pluggable it is attached to.
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
If set, the plugin will be attached to all processes when distributed, not just the main process.
corpus
model
pluggable
trainer
- after_training_epoch(epoch, **kw)View on GitHub#
Saves the model each k epochs.
- 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
]