[tune] support hierarchical search spaces for hyperopt#11431
[tune] support hierarchical search spaces for hyperopt#11431richardliaw merged 3 commits intoray-project:masterfrom
Conversation
|
@amogkam can you review? ping me when approved + tests passing - thanks! |
amogkam
left a comment
There was a problem hiding this comment.
LGTM! Just left one clarification comment mostly for my understanding. Looks like the test is timing out though.
python/ray/tune/suggest/hyperopt.py
Outdated
| category, prefix=par) | ||
| if isinstance(category, dict) else | ||
| HyperOptSearch.convert_search_space( | ||
| dict(enumerate(category)), prefix=f"par/{i}") |
There was a problem hiding this comment.
What exactly is prefix used for/why is the variable par used as the prefix for dicts but as a string for lists? How is this reflected in the config dict?
There was a problem hiding this comment.
There's an error here, thanks - I'll fix it. Basically we need the prefix to avoid duplicate labels in hyperopt
There was a problem hiding this comment.
So par is always a string. Dicts then have their subkeys, so it will be a/x, a/y anyway. But lists have to be converted to dicts in order to be convertable, and we then end up with a/0, a/1, etc. Resolving the values should be fine, as we end up with dicts with integer indices - they are not lists, but can still be accessed with numerical indices. See also the test for this.
|
@richardliaw tune tests are passing. should be ready to merge. |
Why are these changes needed?
Adds support for hierarchical search spaces using hyperopt.
This will now work with HyperOpt:
and result in configs like this:
Related issue number
Closes #11216
Checks
scripts/format.shto lint the changes in this PR.