detrium.core.config

Clean configuration loader and lazy object container for Detrium. Supports: - File paths, built-in package recipe names, or in-memory Python dicts - Recursive `__include__` YAML composition with safe deep merging - Clean field names (`epochs`, `lr_scheduler_type`) while normalizing legacy aliases - Stateless instantiation via `detrium.core.registry` - Registered VFM teachers (no hardcoded if/elif teacher branches)

class DetriumConfig

Isolated configuration and lazy component builder for a single Detrium model/run.

名称类型默认值
cfg_or_pathUnion[str, Path, Mapping[str, Any]]—
disable_backbone_pretrainedboolFalse
overridesAny—
get_optim_params(cfg: Mapping[str, Any], model: nn.Module) -> Any

Build regex-matched parameter groups (preserving MuAdamW/MuSGD param metadata).

名称类型默认值
cfgMapping[str, Any]—
modelnn.Module—
merge_dict(base: Dict[str, Any], override: Mapping[str, Any], *, inplace: bool=False) -> Dict[str, Any]

Recursively merge `override` into `base`.

名称类型默认值
baseDict[str, Any]—
overrideMapping[str, Any]—
inplaceboolFalse
dictify(dotted_key: str, value: Any) -> Dict[str, Any]

Convert `'a.b.c'` + `val` into `{'a': {'b': {'c': val}}}`.

名称类型默认值
dotted_keystr—
valueAny—
parse_cli_overrides(items: Optional[List[str]]) -> Dict[str, Any]

Parse `['a.b=1', 'epochs=50']` into a nested override dict.

名称类型默认值
itemsOptional[List[str]]—
load_yaml_config(file_path: Union[str, Path]) -> Dict[str, Any]

Load a YAML config file with recursive `__include__` resolution.

名称类型默认值
file_pathUnion[str, Path]—