[tune] Refactor search algorithms (#7037)

* start refactoring of search algorithms

* format

* needs tests

* fix

* suggestions

* Fix PBT

* lint

* refactoring

* hyperopt_working

* dragonfly

* hyperopt

* change_half_of_algs

* save

* code-removed

* remove_lots_of_unneccessary

* changes

* formatting

* suggest

* reset

* rm

* tests

* search-change

* exception

* refactor-doc

* search

* py

* moredocs

* Update doc/source/tune-searchalg.rst

* concurrency

* max

* tune

* betterwarning

* bohb

* tests

* test-change

Co-authored-by: ujvl <misraujval@gmail.com>
This commit is contained in:
Richard Liaw
2020-04-27 08:51:13 -07:00
committed by GitHub
co-authored by ujvl
parent 1d5bceddf0
commit 87557a00fa
31 changed files with 527 additions and 611 deletions
+5 -6
View File
@@ -57,7 +57,9 @@ See the API documentation (:ref:`repeater-doc`) for more details.
search_alg = BayesOpt(...)
re_search_alg = Repeater(search_alg, repeat=10)
tune.run(trainable, search_alg=re_search_alg)
# Repeat 2 samples 10 times each.
tune.run(trainable, num_samples=20, search_alg=re_search_alg)
.. note:: This does not apply for grid search and random search.
.. warning:: It is recommended to not use ``Repeater`` with a TrialScheduler.
@@ -352,11 +354,8 @@ If you are interested in implementing or contributing a new Search Algorithm, th
Model-Based Suggestion Algorithms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Often times, hyperparameter search algorithms are model-based and may be quite simple to implement. For this, one can extend the following abstract class and implement ``on_trial_result``, ``on_trial_complete``, and ``suggest``. The abstract class will take care of Tune-specific boilerplate such as creating Trials and queuing trials:
Often times, hyperparameter search algorithms are model-based and may be quite simple to implement. For this, one can extend the following abstract class and implement ``on_trial_complete``, and ``suggest``.
.. autoclass:: ray.tune.suggest.SuggestionAlgorithm
.. autoclass:: ray.tune.suggest.Searcher
:show-inheritance:
:noindex:
.. automethod:: ray.tune.suggest.SuggestionAlgorithm.suggest
:noindex:
+8 -3
View File
@@ -10,6 +10,11 @@ Repeater
.. autoclass:: ray.tune.suggest.Repeater
ConcurrencyLimiter
------------------
.. autoclass:: ray.tune.suggest.ConcurrencyLimiter
AxSearch
--------
@@ -61,10 +66,10 @@ SearchAlgorithm
.. autoclass:: ray.tune.suggest.SearchAlgorithm
:members:
SuggestionAlgorithm
-------------------
Searcher
--------
.. autoclass:: ray.tune.suggest.SuggestionAlgorithm
.. autoclass:: ray.tune.suggest.Searcher
:members:
:private-members:
:show-inheritance: