Compose parameters for DEBUG mode
See original GitHub issueDescription
I found it due to the config file, I cannot do dynamic stuff like
if DEBUG:
epochs=1
else:
epochs=100
One way of doing so is leverage the environment and create a debug environment. However, it is only composable for additional key, if identical keys exist, the debug enviornment will overwrite completely.
Context
This is very common usage to have a debug mode running fast development
Possible Implementation
Instead of overwrite the key, it should merge them, the provided environment should have higher priority. It also avoids duplicate the parameters, especially for ML project the # of parameters can be large. We should only specify the parameters that is changed.
What I wanted:
base
model:
layer: 32
epochs: 100
debug
model:
epochs: 1
result
model:
layer: 32
epochs: 1
Current behavior
base
model:
layer: 32
epochs: 100
debug
model:
epochs: 1
result
model:
epochs: 1
Possible Alternatives
A library like hydra provides the ability to compose two configuration file. We just need to merge two dictionary instead of overwriting it.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)

Top Related StackOverflow Question
Yeah I agree with you, I had made a note of this for a future team discussion. 😃 There might’ve been an “explicit is better than implicit” motivation back when this was implemented, though.
Hi @noklam I think you can achieve this currently using the
TemplatedConfigLoader. Assuming you have a base configThen you can dedicate
globals.ymlin each environment:debug/globals.yml
base/globals.yml
You can find an example in the documentation.