Closed yfeng24816 closed 2 years ago
Hi @yfeng24816,
Yes, Hydra selects the TPE sampler by default (see here).
You need to override the hydra/sweeper/sampler
group using the defaults list.
Please try adding the following to your config:
defaults:
- /hydra/sweeper/sampler: random # using RandomSamplerConfig
@yfeng24816 did this solve your problem?
@yfeng24816 did this solve your problem?
Yes Jasha, thank you. Closing this issue.
Is there a way to use Optuna's GridSampler? I tried this in config but failed
It is possible to use hydra's -m option with command line interface for grid search, and in fact I used it pretty often. But I just hope if there is something more consistent. And Optuna's hyper parameter search outputs a optimization_results.yaml
which I found very handy for loading search result.
Editing this file (https://github.com/facebookresearch/hydra/blob/8d45045e1408ca9d67a504c2372fb732bb9e6920/plugins/hydra_optuna_sweeper/hydra_plugins/hydra_optuna_sweeper/config.py#L129) might work but problem is that GridSampler does not accept the seed
argument (which is used by all supported Optuna samplers for now) for instantiation.
This might require some restructuring at a higher level.
I suppose no. https://github.com/facebookresearch/hydra/issues/1815 says the grid-search sampler is not supported.
closing. pls follow #1815 instead.
🐛 Bug
Description
Got this error when using Optuna random sampler
This is my config
This is weird because
consider_prior
is not in the config of RandomSampler of HydraUpdate(Debugging)
This seems to be hydra defaults to load the TPE config.
In this file, it first loads the defaulted TPE config, then my randomSampler config. But when doing the merge, the randomSampler's config did not override the redundant parts like
consider_prior
, making them passed to Optuna's RandomSampler, and caused error.Is there a way to manipulated the defaulted TPE config and avoid the error?
Checklist