Replies: 4 comments
-
I have not seen the pattern The usual pattern is |
Beta Was this translation helpful? Give feedback.
-
Thank you for the help. I managed to succesfully structure my config like that. However, I am wondering if there is a way to omit the package path (everything before the @ symbol). I have plenty of nested structure and it makes the shell commands incredibly verbose. Correct me if I am wrong, but it seems like hydra should be able to find those packages even without that explict string, by using what is written in the config. |
Beta Was this translation helpful? Give feedback.
-
So you want to write Hydra uses the filesystem tree to organize yaml files. If a yaml file is deeply nested on your filesystem, then you'll need to use a deeply-nested name to look it up. |
Beta Was this translation helpful? Give feedback.
-
You can get some traction using Hydra's support for Interpolation in the Defaults List.
$ cat my_app.py
import hydra
from omegaconf import OmegaConf
@hydra.main(config_path="conf", config_name="config", version_base=None)
def app(cfg):
print(OmegaConf.to_yaml(cfg))
app() $ cat conf/config.yaml
defaults:
- model: ???
- model/lscd@model: ${model}_apd $ cat conf/model/lscd/binary_apd.yaml
model_spec: binary apd $ cat conf/model/lscd/graded_apd.yaml
model_spec: graded apd With the yaml files set up like this, the defaults list interpolation
|
Beta Was this translation helpful? Give feedback.
-
I have a configuration structure like this:
But I would like to have this:
I know that from the shell, or even from
config.yaml
, I can setmodel=lscd/graded/apd.yaml
. However, if I don't type anything into the shell (model is marked with???
inconfig.yaml
, Hydra will complain that no value was provided, it will try to output a list of possible configurations, but the list will be empty.Is there some way to modify the config search path to allow Hydra to find config "subgroups"?
Beta Was this translation helpful? Give feedback.
All reactions