noether.core.initializers.checkpoint

Classes

CheckpointInitializer

Helper class that provides a standard way to create an ABC using

Module Contents

class noether.core.initializers.checkpoint.CheckpointInitializer(initializer_config, **kwargs)

Bases: noether.core.initializers.base.InitializerBase

Helper class that provides a standard way to create an ABC using inheritance.

Initialize model from checkpoint.

Parameters:
  • initializer_config (noether.core.schemas.initializers.CheckpointInitializerConfig) – configuration for the initializer. Implements the CheckpointInitializerConfig schema.

  • **kwargs – additional arguments to pass to the parent class.

checkpoint: str | noether.core.utils.training.training_iteration.TrainingIteration
run_id
model_name
load_optim
model_info
pop_ckpt_kwargs_keys
stage_name
init_run_path_provider
init_optimizer(model)

Initialize the optimizer for the model if it is derived from Model.

If model is a CompositeModel, nothing happens. This is expected as CompositeModels can be arbitrarily nested and do not have an optimizer. Instead, a CompositeModel calls init_optim with all its submodels which can be of type Model or a nested CompositeModel.

Parameters:

model (noether.core.models.ModelBase) – a model to initialize the optimizer for. Assumes the model has an attribute optim.

Return type:

None