scvi.train.SaveBestState#
- class scvi.train.SaveBestState(monitor='elbo_validation', mode='min', verbose=False, period=1)[source]#
Bases:
pytorch_lightning.callbacks.base.Callback
Save the best module state and restore into model.
- Parameters
Examples
from scvi.train import Trainer from scvi.train import SaveBestState
Attributes table#
Methods table#
|
|
|
Called when either of train/val/test epoch ends. |
|
Called when the train ends. |
|
Called when the train begins. |
Attributes#
state_key#
- SaveBestState.state_key#
Identifier for the state of the callback.
Used to store and retrieve a callback’s state from the checkpoint dictionary by
checkpoint["callbacks"][state_key]
. Implementations of a callback need to provide a unique state key if 1) the callback has state and 2) it is desired to maintain the state of multiple instances of that callback.- Return type