In my Machine Learning project I have a high number of parameters that are loaded from a configuration file, e.g. a YAML file. I wonder, is there any best practice on how to integrate them in the codebase other than a number of 'setup_by_cfg'…
With OmegaConf, is it possible to "turn off" node interpolation, so that when you access an interpolation node it just returns the literal string, i.e. "${resolver:value}" instead of evaluating the interpolation?
I have a program that uses…
Say I have the following hydra config test.yaml:
list1 : [0]
list2 : [1,2,3]
is it possible to merge list1 and list2 into a new list that contains [0,1,2,3], perhaps using variable interpolation?
Here is the hydra code:
import hydra
from omegaconf…
In Hydra I have the following configuration:
├── conf
│ ├── config.yaml
│ ├── callbacks
│ │ ├── callback_01.yaml
│ │ └── callback_02.yaml
│ └── trainer
│ ├── default.yaml
The callbacks have a…
nodes:
node1: 1
node2: 2
node3: 3
selected_node: ${subfield:${nodes},node1}
Can I make a subfield resolver that returns nodes["node1"] and stores it in selected_node?
My attempts so far result in this…
Is there a better way to reload a hydra config from an experiment with enumerations? Right now I reload it like so:
initialize_config_dir(config_dir=exp_dir, ".hydra"), job_name=config_name)
cfg = compose(config_name,…
I would like to use python datatypes - both built-in and imported from libraries such as numpy, tensorflow, etc - as arguments in my hydra configuration.
Something like:
# config.yaml
arg1: np.float32
arg2: tf.float16
I'm currently doing this…
In my project, I'm setting an environment variables using python-dotenv.
I then reference it in my YAML using the co.env OmegaConf resolver.
# config.yaml
var1: 42
var2: ${oc.env:PROJECT_NUMBER}
# .env
PROJECT_NUMBER=99
Once I run my script,…
OmegaConf allows you to register a custom resolver. Here is an example of resolving a tuple.
def resolve_tuple(*args):
return tuple(args)
OmegaConf.register_new_resolver("tuple", resolve_tuple)
This can be used to resolve a value in a config…
Currently, I have this configuration file which I'm using as an input to hydra/omegaconf
db:
range:
- -10
- 10
Since the values in the range field are related by simple algebra, I'm looking for a way to encode this into the…
I am using hydra composition with the following structure:
├── configs
│ ├── config.yaml
│ ├── data
│ │ ├── dataset_01.yaml
│ │ └── dataset_02.yaml
│ └── model
│ ├── bert.yaml
│ └──…
I want to pass in a config like:
foo
blah.bar: blah.bar
another.thing: some.thing
And I want to do this on the commmandline, osmething like:
python my_script.py foo.blah.bar=blah.bar foo.another.thing=some.thing
Obviously, this would give…
I'm new to Hydra, so sorry for the nooby question.
Update: Thanks, Omry Yadan for pointing out an example would be helpful. Indeed while putting it together I realize that I was not providing enough information.
My question revolves around the use…
By configuring the setup mentioned in (https://github.com/Sachini/niloc), i am facing issue in running the script (test/train). It gives me the following error
File…