Reputation: 31
Assuming the following config structure:
config.yaml
|-model
| |--default.yaml
|
|-data
|--default.yaml
config.yaml
:
defaults:
- model: default
- data: default
model/default.yaml
:
...
x_label: some_label
...
The following doesn't work:
data/default.yaml
:
...
loaders:
${model.x_label}:
param1: a
param2: b
...
Is there a way to make something like this work? Or an equivalent alternative?
Upvotes: 3
Views: 1182
Reputation: 7797
Currently this is unspported in Hydra/OmegaConf; values can be interpolations, but keys cannot.
As a workaround, consider the following for your data/default.yaml
file:
...
loaders:
label: ${model.x_label}
params:
param1: a
param2: b
...
Upvotes: 1