Config Saver Callback
Lightning callback for storing CAREamics configuration in checkpoints.
ConfigSaverCallback
Bases: Callback
Callback to save CAREamics configuration in Lightning checkpoints.
This callback automatically stores CAREamics version, experiment name, and training configuration in the checkpoint file for reproducibility. If a training data configuration is provided, it is also persisted into the checkpoint independently of the datamodule currently active on the trainer.
Parameters:
-
careamics_version(str) –Version of CAREamics used for training.
-
experiment_name(str) –Name of the experiment.
-
training_config(TrainingConfig) –Training configuration to store in checkpoint.
-
data_config(DataConfig | None, default:None) –Training data configuration to store in checkpoint. If provided, it is written into the checkpoint regardless of which datamodule is active on the trainer, ensuring the checkpoint keeps the training data config even when saved after prediction.
Attributes:
-
careamics_version(str) –Version of CAREamics used for training.
-
experiment_name(str) –Name of the experiment.
-
training_config(TrainingConfig) –Training configuration to store in checkpoint.
-
data_config(DataConfig | None) –Training data configuration to store in checkpoint.
__init__(careamics_version, experiment_name, training_config, data_config=None)
Initialize the callback.
Parameters:
-
careamics_version(str) –Version of CAREamics used for training.
-
experiment_name(str) –Name of the experiment.
-
training_config(TrainingConfig) –Training configuration to store in checkpoint.
-
data_config(DataConfig | None, default:None) –Training data configuration to store in checkpoint. If provided, it is written into the checkpoint regardless of which datamodule is active on the trainer.