noether.core.schemas.initializers

Attributes

Classes

Module Contents

class noether.core.schemas.initializers.InitializerConfig(/, **data)

Bases: pydantic.BaseModel

Parameters:

data (Any)

kind: str = None
kwargs: dict[str, Any] | None = None

Additional keyword arguments to pass to the initializer.

run_id: str

A unique identifier for the training stage. This is used to find the correct checkpoint.

stage_name: str | None = None

The name of the stage training stage if defined. When training, the stage name is usually “train”.

model_name: str | None = None

The name of the model to load. This is the model_name used in CheckpointCallback.

model_info: str | None = None

Optional string that is used as suffix in the checkpoint filename.

checkpoint: str | None | dict = None

Which checkpoint to load. Checkpoint is usually “latest” or “best_loss”, depending on which checkpoint you want to load.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class noether.core.schemas.initializers.CheckpointInitializerConfig(/, **data)

Bases: InitializerConfig

Parameters:

data (Any)

kind: Literal['noether.core.initializers.CheckpointInitializer'] = None
load_optim: bool = None

Whether or not to load the optimizer state from the checkpoint. Default is True, as this is usually used to resume a training run

pop_ckpt_kwargs_keys: list[str] | None = None

which checkpoint to load. If a string is provided, must be one of (“latest”, “best_loss”). If a dictionary is provided, must contain keys “epoch”, “update”, “sample” to identify the checkpoint.

class noether.core.schemas.initializers.ResumeInitializerConfig(/, **data)

Bases: CheckpointInitializerConfig

Parameters:

data (Any)

kind: Literal['noether.core.initializers.ResumeInitializer'] = None
load_optim: bool = None

Whether or not to load the optimizer state from the checkpoint. Default is True, as this is usually used to resume a training run

model_name: str = None

The name of the model to load. This is the model_name used in CheckpointCallback.

class noether.core.schemas.initializers.PreviousRunInitializerConfig(/, **data)

Bases: CheckpointInitializerConfig

Parameters:

data (Any)

kind: Literal['noether.core.initializers.PreviousRunInitializer'] = None
load_optim: bool = None

Whether or not to load the optimizer state from the checkpoint. Default is True, as this is usually used to resume a training run

keys_to_remove: list[str] | None = None

List of keys to remove from the checkpoint.

patterns_to_remove: list[str] | None = None

List of patterns to remove from the checkpoint.

patterns_to_rename: list[dict] | None = None

List of patterns to rename in the checkpoint.

patterns_to_instantiate: list[str] | None = None

List of patterns to instantiate in the checkpoint.

noether.core.schemas.initializers.AnyInitializer