ksuit.initializers.base.checkpoint_initializer¶
Classes¶
Helper class that provides a standard way to create an ABC using |
Module Contents¶
- class ksuit.initializers.base.checkpoint_initializer.CheckpointInitializer(initializer_config, **kwargs)¶
Bases:
ksuit.initializers.base.initializer_base.InitializerBaseHelper class that provides a standard way to create an ABC using inheritance.
Initialize model from checkpoint.
- Parameters:
initializer_config (ksuit.schemas.initializers.CheckpointInitializerConfig) – configuration for the initializer. Implements the CheckpointInitializerConfig schema.
**kwargs – additional arguments to pass to the parent class.
- 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 (ksuit.models.model_base.ModelBase) – a model to initialize the optimizer for. Assumes the model has an attribute optim.
- Return type:
None