Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does tango provide a way to compose config files #370

Open
BigRedT opened this issue Aug 25, 2022 · 3 comments
Open

Does tango provide a way to compose config files #370

BigRedT opened this issue Aug 25, 2022 · 3 comments
Labels
question Further information is requested

Comments

@BigRedT
Copy link
Contributor

BigRedT commented Aug 25, 2022

Config files for machine learning projects can often get quite long (data paths, model config, training hyper-parameters). In past projects, I have used frameworks like Hydra to compose smaller config files. This also allows swapping out individual components. Does Tango provide a way to compose config files?

@BigRedT BigRedT added the question Further information is requested label Aug 25, 2022
@epwalsh
Copy link
Member

epwalsh commented Aug 25, 2022

I'm not familiar with Hydra but that looks interesting.

JSONNET does allow sourcing from other JSONNET files. So I often make a common.jsonnet file where I put step definitions and hyperparameaters that I use in other configs, and source those into the other configs. Does that solve your use case?

@BigRedT
Copy link
Contributor Author

BigRedT commented Aug 25, 2022

Could you share an example of how that works in jsonnet? Also, is there something similar for yaml? I prefer yaml slightly because it has less syntax/brackets etc cluttering the file :)

@epwalsh
Copy link
Member

epwalsh commented Aug 25, 2022

I do like YAML syntax better as well, but tend to use JSONNET because of all its features.

So for example, create a file common.jsonnet:

{ hyperparams: { learning_rate: 0.01 } }

Then in another file, say train.jsonnet, you can do this:

local common = import "common.jsonnet";

{
  steps: {
    train: { type: "...", learning_rate: common["hyperparams"]["learning_rate"] }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants