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

Setting the attributes of a default config in subgroups #161

Closed
saleml opened this issue Aug 25, 2022 · 1 comment · Fixed by #234
Closed

Setting the attributes of a default config in subgroups #161

saleml opened this issue Aug 25, 2022 · 1 comment · Fixed by #234

Comments

@saleml
Copy link

saleml commented Aug 25, 2022

Describe the bug
Not sure whether it's a bug, or it's expected:

After specifying the default config in a subgroups, changing the inner attributes of the default configuration requires prior specification within the subgroups.

To Reproduce
The same code in the example provided in subgroups.

$ python issue.py --model model_a --model.lr 1e-2
Config(model=ModelAConfig(lr=0.01, optimizer='Adam', betas=(0.9, 0.999)), dataset=Dataset2Config(data_dir='data/bar', bar=1.2))
$ python issue.py --model.lr 1e-2. % I was expecting this to work given that both model configs have `lr` attribute
Config(model=ModelAConfig(lr=0.0003, optimizer='Adam', betas=(0.9, 0.999)), dataset=Dataset2Config(data_dir='data/bar', bar=1.2))
$ python issue.py --model model_a --model.betas 0. 1.
Config(model=ModelAConfig(lr=0.0003, optimizer='Adam', betas=(0.0, 1.0)), dataset=Dataset2Config(data_dir='data/bar', bar=1.2))
$ python issue.py --model.betas 0. 1. % ModelA being the default, I was expecting this two work
Config(model=ModelAConfig(lr=0.0003, optimizer='Adam', betas=(0.9, 0.999)), dataset=Dataset2Config(data_dir='data/bar', bar=1.2))

Desktop (please complete the following information):

  • Version 0.0.20
  • Python version: 3.10
@lebrice
Copy link
Owner

lebrice commented Aug 25, 2022

Nice catch! This new subgroups feature needs a bit more testing. Thanks for pointing this out!

lebrice added a commit that referenced this issue Mar 13, 2023
Fixes #161

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
lebrice added a commit that referenced this issue Mar 13, 2023
* Add test to confirm that #160 is fixed

Fixes #160

* Add test to assert that #161 is fixed

Fixes #161

---------

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants