espnet3.contract.stages.stage_log_dir
Less than 1 minute
espnet3.contract.stages.stage_log_dir
espnet3.contract.stages.stage_log_dir(system: Any, name: str) → Path
Return the log directory for stage name on system.
Reads the stage’s declared config role’s config object off system (e.g. system.training_config) and its log_dir dotted key, falling back to system._default_log_dir when the config, the key, or its value is absent. When a stage declares more than one role, the first role whose config is set on system (in declaration order) is used.
Examples
>>> from omegaconf import OmegaConf
>>> class ExampleSystem:
... stages = (
... StageSpec(name="train", config="training", log_dir="exp_dir"),
... )
... training_config = OmegaConf.create({"exp_dir": "exp"})
... _default_log_dir = Path("logs")
>>> stage_log_dir(ExampleSystem(), "train")
PosixPath('exp')