-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
[Feature Request] Define a sweep in config.yaml file rather than command line #1376
Comments
I think this can be added as a part of the change to standardize the configuration of the search space of HPO sweepers. We have some work in that direction, but it's stalled. (cc @shagunsodhani). To set expectations: |
I am very much interested in this feature, that's why I had opened a duplicate #1948 . Reposting here an additional request that I had regarding this feature: do you think it would be possible to make it work with this type of sweep? i.e. |
Modifying the example from PR #1886, I've had success with the following defaults:
- db: ???
- _self_
top: ???
hydra:
sweeper:
params:
# db: glob(*)
# db.timeout: 5,10
top: "{a:10,b:20},{a:100,b:200}" These settings for
+top: "{a:10,b:20},{a:100,b:200}" |
Amazing, sorry I didn't try to test it earlier. |
Glad to hear it 😁 |
@Jasha10 I have experimented a bit now, and I would like to know how you would go about trying to put the sweep part in a different configuration file (separate from the one defining the defaults and say the basic configuration parameters)? I tried the following:
Where the content of compile:
lr: 1e-2,1e-3,1e-4 and the content of compile: ??? Running
|
This came up in a [comment on #1376](): there is confusion about CLI overrides for modifying nested defaults. It should be `server/db=mysql`, not `server.db=mysql`.
Thank you for testing the limits of this new feature, @zaccharieramzi. First let me say that you will need Here are two methods to achieve what you're going for, one of which depends on a PR that I have just opened and which is not yet merged into the main branch. Method one: using an
|
@Jasha10 Thanks for this reply! I personally like the first option better, even with the potential copy-pasting I will have to do for different grid searches, because it allows me to have an It could be nice to think about having a shortcut for: # @package _global_
hydra:
sweeper:
params: but certainly not for the next release. I also tried the following syntax: # @package _global_
hydra:
sweeper:
params:
+compile: "{lr:1e-2,wd:1e-4},{lr:1e-3,wd:1e-5}" and it worked perfectly as expected. Can't wait for the next release, and actually I will probably use it right away ahah! |
Hi @Jasha10, thank you for the explaination. Unfortunately, neither option is working in my case. When trying method one, I get this error: While for method two, I get: Did something change? Maybe I am making mistakes in the config file? I kind of tried all possible combinations. This is the python script with my_app(): Thank you in advance. Best, Giorgio |
@GiorgioBarnabo for method 1 to work, you will need to install a recent development version of Hydra (e.g. Method 2 is currently not working (as we have closed PR #1956). |
This came up in a [comment on facebookresearch#1376](): there is confusion about CLI overrides for modifying nested defaults. It should be `server/db=mysql`, not `server.db=mysql`.
🚀 Feature Request
Currently a sweep can only be defined on the command line. Could it be supported through the config files as well?
Motivation / pitch
Situations where this particularly makes sense:
python train.py seed="range(0,10)" xval_fold="range(0,5)" actual_hyperparam_I_want_to_change=1,2,3
-- if for any new hyperparameter combination we always want to run over those several seeds and cross-validation folds.
For those cases I'd like to be able to have those sweeps in
config.yaml
, to declutter the command line.Couldn't find prior discussions about this, but somewhat related is #394
cc @liujas000
The text was updated successfully, but these errors were encountered: