Skip to content

Question: can default yaml be overridden inside other yamls? #221

Open
@vedal

Description

@vedal

Sorry for all the questions. Please feel free to ignore it.

I wonder if its possible to define, and then override/extend, yaml defaults inside other yamls. This is supported in Hydra through default configs.

The reason I'd like to have this is to have an entire experiment defined inside a yaml, both the default and "override" values. An alternative would be specifying several --config on the command line.

Example:
Say I want to use most values from default_data_config.yaml but change batch_size. In Hydra, I'd write the following experiment config:

defaults:
  - data: default_data_config.yaml
  - _self_

data: 
  batch_size: 4

This way, data will be populated by defaults, and batch_size will be overridden. The "__self__" notation on the bottom of the list means the configs in the current file override defaults.

I noticed that referencing yamls inside other yamls is supported in jsonargparse, but could find anything about overrides.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions