specsr.config¶
Configuration loading for the training stages.
Configs come from two places and they do not look the same:
Hand-written YAML, a flat mapping of
name: value.Weights & Biases run dumps, where every entry is wrapped as
name: {value: ...}and a_wandbkey carries run metadata (host, GPU, git commit, …) that is not configuration at all.
The shipped config.yaml files in this project are the second kind. Loading
one naively gives every hyperparameter as the dict {"value": ...}, so
float(cfg["lr"]) raises and, worse, cfg.get("dropout", 0.1) silently
returns a dict that some call sites will happily pass into a layer constructor.
load_config() normalises both forms.
Functions
|
Load a YAML config, normalising W&B run dumps, then apply |
|
Return |
|
Flatten a W&B-style |
- specsr.config.load_config(path, **overrides)[source]¶
Load a YAML config, normalising W&B run dumps, then apply
overrides.Overrides whose value is
Noneare ignored, so argparse defaults can be passed straight through without clobbering the file.