-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[tune] use default anonymous metric _metric
if at least a mode is set
#12159
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # python/ray/tune/tests/test_searchers.py
richardliaw
reviewed
Nov 21, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like a kosher change though tests are failing?
Mainly comments regarding docstring.
Failing test is |
richardliaw
reviewed
Nov 23, 2020
richardliaw
approved these changes
Nov 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Ray Tune already supports an anonymous metric if e.g.
tune.report(0.5)
is called or a scalar value isreturn
ed in the (function) trainable. However, it is currently not used automatically, i.e. users will have to specifytune.run(train, mode="max", metric="_metric")
to use this metric in the searchers, schedulers, progress reporting, and experiment analysis.This PR changes this behavior so that the default
_metric
is used when no other metric has been specified but amode
has been set. Thus, the API reduces totune.run(train, mode="max")
.I think it's sensible to require setting a mode, as we cannot assume if we're optimizing for higher or lower values. Other libraries make this assumption, or default to one direction. Also, by explicitly setting a mode but not a metric, we can assume that the user actually wants to optimize an anonymous metric.
Related issue number
Checks
scripts/format.sh
to lint the changes in this PR.