[RLlib] Cast types for new configurations in PB2
.
#42181
Merged
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.
Fixed a bug in generating a new config in 'PB2'. The type for floats were actually 'numpy.dtype.float64' and resulted so far in error in 'ray.rllib.utils.schedule.Scheduler.validate()' where this type is not allowed for the learning rate,
Why are these changes needed?
PB2
as one of Ray major hyperparameter tuning algorithms for ML and specifically RL was erroring out when tuning the learning rate. This was due to the fact thatray.rllib.utils.schedule.Scheduler.validate
is allowing only specific types for the learning rate. WheneverPB2
created a new config it assigned the values received fromray.tune.schedulers.pb2._explore
and that was typenumpy.dtype.float64
. So, basically it was not possible to tune the learning parameter in experiments.This PR fixes this shortcoming and casts types from a new config explored via Bayesian Optimization to the ones from the old config. Like this configs will keep types over the course of an experiment and
PB2
does not error out anymore.Related issue number
Closes #42180
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.