Default Config Values
Default Config Values
Every ESPnet3 recipe config is merged with a set of packaged defaults before it is used. You only need to write the fields you want to override — the rest come from the defaults automatically.
Where defaults come from
The defaults live in the egs3/TEMPLATE/<task>/conf/ directory inside the ESPnet3 repository. For an ASR recipe, the default files are:
egs3/TEMPLATE/asr/conf/
├── training.yaml
├── inference.yaml
├── metrics.yaml
├── publication.yaml
└── demo.yamlThese files are the canonical starting point for every ASR experiment. They contain working values for optimizer, scheduler, trainer, dataloader, and parallel settings so a new recipe does not need to redeclare everything from scratch.
How merging works: load_and_merge_config
run.py loads configs through load_and_merge_config:
training_config = load_and_merge_config(
args.training_config, # your conf/training.yaml
config_name="training.yaml",
default_package=__package__, # egs3.TEMPLATE.asr
)The merge order is:
- Load the default config from
egs3/TEMPLATE/asr/conf/training.yaml - Load your recipe config (e.g.
egs3/mini_an4/asr/conf/training.yaml) without resolving interpolations yet - Merge — your values override the defaults, missing fields keep the default values
- Resolve all
${...}interpolations on the merged result
This means your recipe config is always an override layer on top of the template, not a standalone file.
Tips
If a field is not in your recipe config, the value from egs3/TEMPLATE/asr/conf/ applies. You do not need to copy fields you are happy with.
Using another recipe's config as defaults
The default_package argument does not have to point to egs3.TEMPLATE. You can point it at any installed recipe package that provides a conf/ directory — for example, egs3.librispeech.asr:
training_config = load_and_merge_config(
args.training_config,
config_name="training.yaml",
default_package="egs3.librispeech.asr",
)This loads egs3/librispeech/asr/conf/training.yaml as the base and merges your recipe config on top of it.
Note
default_package can be any importable Python package path, as long as that package has a conf/ directory with the requested config file. The package must be installed or on PYTHONPATH.
Automatic inference of default_package
When default_package is not given explicitly, load_and_merge_config infers it from the path of your recipe config. A config at egs3/<recipe>/asr/conf/training.yaml maps to egs3.TEMPLATE.asr.
This means most recipes do not need to set default_package at all — the standard run.py template passes __package__ which resolves correctly for recipes that follow the egs3/<recipe>/<task>/ directory layout.
