noether.core.initializers.resume

Classes

ResumeInitializer

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.CheckpointInitializer

Initializes 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:
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:

TrainingIteration

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:
Return type:

None