Update nested config of ingredient
See original GitHub issueCurrently I work with experiments which inject multiple ingredients. Each of the ingredients has its own YAML config file which is loaded via the ingredient.add_config method. For example ingredient.yaml:
...
solver_cfg:
ada_lr:
factor: 0.1
epochs: []
...
Now I want to change one of the nested configuration parameters only for one of the experiments. The change should also be in the respective experiment.yaml:
...
update_ingredient:
solver_cfg:
ada_lr:
epochs: [100]
...
Is there a way to achieve this with the currently available methods? config_hook and option_hook only work on config updates which are implied by the command line. I could put the updates in a separate YAML file and add this to the ingredient only for the experiment but this will overwrite and not update the solver_cfg entry which loses the factor parameter. Am I missing something?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How can I update the state of an object nested in an array from ...
I do this by creating an empty object in an ingredients array within RecipeCreate, and then iterate over this array of empty objects,...
Read more >Ingredients — Sacred 0.8.3 documentation
Ingredients are a way of defining a configuration with associated functions and possibly commands that can be reused by many different experiments.
Read more >Rails: Nested resource scaffold - devroom.io
This makes sure you only show ingredients for this recipe, and not all ingredients in the database. Because we changed the route for...
Read more >How to UPDATE Nested Object and Table Columns, Part 2
Line 16 use the SUBMULTISET set operator to ensure that only new add elements when they don't already exist in the ingredient ADT...
Read more >Use a nested dynamic form with a has_many :through association in ...
Use a nested dynamic form with a has_many :through association in Rails. ... Ingredients have a name, an amount, and a description. ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

In the short-term ingredients will remain the same, because I currently don’t have the time for an in-depth refactoring. In the medium term, I would like to make ingredients classes, that you include by instantiating them as part of the configuration process. This would make their usage very flexible and hopefully intuitive. Something along these lines:
Which could result in a config like this:
Closing this issue, since we sort-of solved your problem, and solving it completely probably requires larger changes that deserve their own issues.