noether.core.initializers.resume¶
Classes¶
Initializes models/optimizers from a checkpoint ready for resuming training. |
Module Contents¶
- class noether.core.initializers.resume.ResumeInitializer(initializer_config, **kwargs)¶
Bases:
noether.core.initializers.checkpoint.CheckpointInitializerInitializes models/optimizers from a checkpoint ready for resuming training. Needs to be configured as part of the config by setting the resume_run_id in the root config (assumg the same output path is used). This initializer assumes that the previous run is going to be resumed for further training (i.e., trianing is not finished yet)
For example (config snippet is part of the trainer config):
resume_run_id: <previous_run_id>
- Parameters:
initializer_config (noether.core.schemas.initializers.ResumeInitializerConfig) – configuration for the initializer. See
ResumeInitializerConfigfor available options.**kwargs – additional arguments to pass to the parent class.
- init_weights(model)¶
Initialize the model weights from the checkpoint.
- Parameters:
model (noether.core.models.ModelBase) – the model to load the weights into.
- Return type:
None
- init_optimizer(model)¶
Initialize the optimizer for the model.
- Parameters:
model (noether.core.models.ModelBase) – a model to initialize the optimizer for.
- Return type:
None
- start_checkpoint()¶
Get the start checkpoint for the model.
- Returns:
the start checkpoint for the model.
- Return type:
- init_trainer(trainer)¶
Initialize the trainer from the checkpoint.
- Parameters:
trainer (noether.training.trainers.BaseTrainer) – the trainer to initialize.
- Return type:
None
- init_callbacks(callbacks, model)¶
Initialize the callbacks from the checkpoint.
- Parameters:
callbacks (list[noether.core.callbacks.CallbackBase]) – the callbacks to initialize.
model (noether.core.models.ModelBase) – the model to initialize the callbacks for.
- Return type:
None