Questions about Hydra, an open source Python framework by Facebook
Questions tagged [fb-hydra]
182 questions
0
votes
1 answer
fb-hydra: How to make inner configurations inherit outer configuration fields PARTLY?
I have 2 configs like, and I want to make inner config PARTLY inherit outer config. Thank you for your help!
this is the outer config:
# config.yaml
defaults:
- _self_
- model: pct
lr: 1e-3
num_epoch: 200
weight_decay: 5e-4
scheduler_stepsize:…

Alobal
- 1
- 1
0
votes
1 answer
Overwriting hydra configuration groups from CLI
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
conf
├── config.yaml
├── optimizer
│ ├── adamw.yaml
│ ├── adam.yaml
│ ├── default.yaml
│ └── sgd.yaml
├──…

Pietro
- 415
- 6
- 16
0
votes
1 answer
When using the optuna plugin for hydra, can I import the search space from another config file?
I want to hyper-parameter optimize multiple time series forecasting models on the same data. I'm using the Optuna Sweeper plugin for Hydra. The different models have different hyper-parameters and therefore different search spaces. At the moment my…

Datenkrake
- 3
- 2
0
votes
1 answer
How to properly generate a multi-level composition?
Currently, my hydra config is organized as follows:
configs/
├── config.yaml
├── data
│ ├── IMDB.yaml
│ └── REUT.yaml
└── model
├── BERT.yaml
├── GPT.yaml
└── loss
├── CrossEntropyLoss.yaml
└──…

Celso França
- 653
- 8
- 31
0
votes
2 answers
Can I get access to the global configs from an arbitrary function in my code?
I apologize in advance if what I'm trying to do is an anti-pattern.
I would like to access my global configuration from somewhere in my code where it would be extremely cumbersome to pass the config object that the hydra-decorated main function…

miccio
- 133
- 1
- 10
0
votes
1 answer
How to use callable targets with dataclass arguments in Hydra?
Is it possible to define a target using Structured Configs to avoid redefining all the parameters?
def good(config: Config):
pass
def bad(param1, param2):
pass
@dataclass
class Config:
param1
param2
_target_: Any = good
#…

Emre
- 5,976
- 7
- 29
- 42
0
votes
2 answers
how can I specify a list on the command line
I have the following configuration with hydra:
data_files: null
theta: 0.2
use_weights: true
I can override this as:
python -m apps.test_hydra data.data_files=x
However, when I try to specify a list as:
python -m apps.test_hydra…

Luca
- 10,458
- 24
- 107
- 234
0
votes
1 answer
How to set up hydra config to accept a custom enum?
How do I set up a my hydra config to accept a custom enum? Specifically I followed the Structured Config Schema tutorial.
I have a dataclass config:
@dataclass_validate
@dataclass
class CustomConfig:
custom_enum: CustomEnum
With the custom…

jlcv
- 1,688
- 5
- 21
- 50
0
votes
1 answer
Hydra: interpolate variable from children node
Given the following config files:
# foo/bar.yaml
_target_: ChildClass
a: 0
b: 1
# config.yaml
defaults:
- foo: bar.yaml
_target_: MainClass
c: 2
d: ${foo.a} # this line doesn't work
I would like to construct an object of type MainClass, which…

miccio
- 133
- 1
- 10
0
votes
1 answer
Get original Hydra configuration from instantiated config
In Hydra I can automatically instantiate my classes, e.g.
_target_: ClassA
foo: bar
model:
_target_: ClassB
hello: world
which results in recursively instantiated classes like where "inner class" instances are passed to "outer…

Nils Werner
- 34,832
- 7
- 76
- 98
0
votes
2 answers
Multirun with glob on files or folders
Assuming a directory structure like this:
/input/files/path
/input1
/file1_1.json
/file1_2.json
/input2
/file2_1.json
/someting_unrelated
...
I want to run a script that is configured using Hydra several times, each time getting…

Michael Litvin
- 3,976
- 1
- 34
- 40
0
votes
1 answer
Define argument for hydra instantiate target as power of 2
In using instantiation, is there a way to define a parameter for a target that is a power of 2? For example:
from sklearn.feature_extraction import HashingVectorizer
vec = HashingVectorizer(n_features=2**18)
vec.transform(["a quick fox"])
<1x262144…

Grr
- 15,553
- 7
- 65
- 85
0
votes
1 answer
In hydra-python structured configs, how do you interpolate values?
I am using structured config (@dataclass-based) with hydra 1.1 and trying to interpolate some values. Specifically, I would like to set the working directory by substituting some of my config values.
I was able to do this consulting the…

nzer0
- 315
- 2
- 10
0
votes
1 answer
overriding the package specified in default list from cli
I am trying to override the package in default list in a hierarchical configuration structure. As a simplified example:
I have conf/base.yaml
defaults:
- _self_
- env@_here_: env1
a: 1
b: 2
conf/env/env1.yaml
c: 5
d: 6
and…

Dee
- 153
- 3
- 15
0
votes
1 answer
Remote execution with on a Single node with Multiple GPU
I am looking into documentation for running hydra on a single node remotely. I am looking for methods where I can run a code present in my local machine and to run it on a GCP instance.
Any pointers?

Sree Aurovindh
- 705
- 1
- 6
- 18