noether.core.configs¶
Submodules¶
Classes¶
Utility class to store and log hyperparameters configurations from a Pydantic model. |
Package Contents¶
- class noether.core.configs.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:
stage_hyperparameters (noether.core.schemas.schema.ConfigSchema) – Hyperparameters to save in a Pydantic object.
out_file_uri (str | pathlib.Path) – Path to the output file.
- 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/tupletags emitted for tuple-typed fields like dataset statistics), resolves theconfig_schema_kindmarker written bysave_resolvedto the concreteConfigSchemasubclass, 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_uridoesn’t exist.pydantic.ValidationError – if the file is missing required fields or the config schema’s validators reject it.
- Return type:
- 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