noether.core.configs.hyperparameters

Classes

Hyperparameters

Utility class to store and log hyperparameters configurations from a Pydantic model.

Module Contents

class noether.core.configs.hyperparameters.Hyperparameters

Utility class to store and log hyperparameters configurations from a Pydantic model.

static save_resolved(stage_hyperparameters, out_file_uri)

Save the resolved config schema hyperparameters to the output file.

Parameters:
Returns:

None

Return type:

None

static load_resolved(file_uri)

Inverse of save_resolved() — load a previously-saved resolved config.

Reads the YAML with yaml.full_load (preserves !!python/tuple tags emitted for tuple-typed fields like dataset statistics), resolves the config_schema_kind marker written by save_resolved to the concrete ConfigSchema subclass, and validates the rest of the dict through Pydantic.

Parameters:

file_uri (str | pathlib.Path) – Path to the YAML file produced by save_resolved (typically <run_dir>/hp_resolved.yaml).

Returns:

The validated config schema instance.

Raises:
  • FileNotFoundError – if file_uri doesn’t exist.

  • pydantic.ValidationError – if the file is missing required fields or the config schema’s validators reject it.

Return type:

noether.core.schemas.schema.ConfigSchema

static log(stage_hyperparameters)

Logs the stage hyperparameters in YAML format without trailing newlines.

Parameters:

stage_hyperparameters (pydantic.BaseModel) – The hyperparameters configuration to log.

Returns:

None

Return type:

None