Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hydra remove default via config file

I am using Hydra to configure my Python application. I really like how it is possible to have a default config and create "overwrites" for certain config properties. However, I can't figure out how to remove a property from the run (eg. delete the property). I saw that via terminal this can be done with python run.py ~foo.bar, but I was wondering how I can do the same with a config file?

For example, in the following config file I am overwriting the max_epochs, but how would I remove the property max_epochs all together?

defaults:
  - override /trainer: minimal.yaml # choose trainer from 'configs/trainer/'

# all parameters below will be merged 
# with parameters from default configurations set above
# this allows you to overwrite only specified parameters
trainer:
  min_epochs: 1
  max_epochs: 100 
  check_val_every_n_epoch: 20 
  gpus: 1
like image 761
Alexus Avatar asked Nov 03 '25 21:11

Alexus


1 Answers

You can't do it from a config file. I suggest that you structure your config in an additive way. Add what you need, instead of removing what you don't.

like image 75
Omry Yadan Avatar answered Nov 05 '25 10:11

Omry Yadan