Overwriting conf groups from CLI #2084
-
Hi there, I am trying to overwrite from the CLI a group of parameters and I am not sure how to do it. The structure of my conf is the following
My # @package task
defaults:
- _self_
- /optimizer/adam@cfg.optimizer
_target_: src.core.task.Task
_recursive_: false
cfg:
prefix_sep: ${training.prefix_sep} while the _target_: null
lr: ${training.lr}
weight_decay: 0.001
no_decay:
- bias
- LayerNorm.weight and one specific optimiser, say adam.yaml, looks like this defaults:
- default
_target_: torch.optim.Adam In the end the config I'd like to be computed is like this task:
_target_: src.task.nlp.nli_generation.task.NLIGenerationTask
_recursive_: false
cfg:
prefix_sep: ${training.prefix_sep}
optimizer:
_target_: torch.optim.Adam
lr: ${training.lr}
weight_decay: 0.001
no_decay:
- bias
- LayerNorm.weight I would like to be able to modify the optimiser via the CLI (say, use sgd), but I am not sure how to achieve this. I tried, but I understand why it fails, this
Any tips on how to achieve this? StackOverflow question here. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
In your snippet you have a period after
That period shouldn't be there |
Beta Was this translation helpful? Give feedback.
-
Solution here. |
Beta Was this translation helpful? Give feedback.
Solution here.