1

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?

colobas
  • 11
  • 1
  • Currently this is unspported in Hydra/OmegaConf; values can be interpolations, but keys cannot. – Jasha Jan 20 '22 at 07:33

1 Answers1

1

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
...
Jasha
  • 5,507
  • 2
  • 33
  • 44