Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] How to select a whole config group by a parameter in other group? #1079

Closed
czrcbl opened this issue Oct 20, 2020 · 1 comment
Closed
Labels
question Hydra usage question

Comments

@czrcbl
Copy link

czrcbl commented Oct 20, 2020

Hi, I am working in a project with configs in the following layout:

config/
    config.yaml
    model/
        model1.yaml
        model2.yaml
    dataset/
        dataset1.yaml
        dataset2
    experiment/
        exp1.yaml
        exp2.yaml

Each experiment will define a specific set of parameters including a specific dataset and a specific model.
I would like to call python train.py experiment=exp2 and automatically select the specified dataset and model and load their params. Is there a way of doing that? In the documentation it has Specializing configuration, but it only shows how to change a parameters instead of the whole config group.

If it is not possible, what would be the recommended alternative workflow?

@czrcbl czrcbl added the enhancement Enhanvement request label Oct 20, 2020
@omry omry added question Hydra usage question and removed enhancement Enhanvement request labels Oct 20, 2020
@omry
Copy link
Collaborator

omry commented Oct 20, 2020

Hi, thanks for the question.
Recursive defaults list (#171) will be the solution for this and many other related problems.
This is not supported in Hydra 1.0 but is coming in 1.1 (Under active development in #1044).

In 1.0, you can only define the defaults list in your primary config.
Your alternatives are for now:

  1. Use command line overrides to override the config group.
  2. Use --config-name to override the primary config to one that has the defaults list you want.

There could be other alternatives I am not thinking of right now.

@omry omry closed this as completed Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Hydra usage question
Projects
None yet
Development

No branches or pull requests

2 participants