[tune] implement shim instantiation (#10456)

* Create ray.tune.suggest.create.create_scheduler

* Update __init__.py

* Resolve conflict in __init__.py

* Create ray.tune.schedulers.create.create_scheduler

* Update __init__.py

* Move create_scheduler to tune.schedulers.__init__

* Move create_searcher to tune.suggest.__init__

* Delete tune.suggest.create

* Delete tune.schedulers.create

* Update imports for shim functions in tune.__init__

* Remove shim from tune.suggest.__init__.__all__

* Remove shim from tune.schedulers.__init__.__all__

* Add ShimCreationTest

* Move ShimCreationTest to test_api

* Delete test_shim.py

* Add docstring for ray.tune.create_scheduler

* Add docstring to ray.tune.create_searcher

* Fix typo in ray.tune.create_scheduler docstring

* Fix lint errors in tune.schedulers.__init__

* Fix lint errors in tune.suggest.__init__

* Fix lint errors in tune.suggest.__init__

* Fix lint errors in tune.schedulers.__init__

* Fix imports in test_api

* Fix lint errors in test_api

* Fix kwargs in create_searcher

* Fix kwargs in create_scheduler

* Merge branch 'master' into shim-instantiation

* Update use-case in docs in tune.create_scheduler

* Update use-case in docs in tune.create_searcher

* Remove duplicate pytest run from test_api

* Add check to create_searcher


Co-authored-by: Richard Liaw <rliaw@berkeley.edu>

* Add check to create_scheduler

* lint

* Compare types of instances in test_api

Co-authored-by: Richard Liaw <rliaw@berkeley.edu>

* Add tune.create_searcher to docs

* Fix doc build

* Fix tests

* Add tune.create_scheduler to docs

* Fix tests

* Fix lint errors

* Update Ax search for master

* Fix metric kwarg for Ax in test_api

* Fix doc build

* Fix HyperOptSearch import in test_api

* Fix HyperOptSearch import in create_searcher

Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
This commit is contained in:
Sumanth Ratna
2020-09-05 12:36:42 -04:00
committed by GitHub
parent f03e91788a
commit 54215ff287
6 changed files with 197 additions and 2 deletions
+6
View File
@@ -196,3 +196,9 @@ TrialScheduler
.. autoclass:: ray.tune.schedulers.TrialScheduler
:members:
Shim Instantiation (tune.create_scheduler)
------------------------------------------
There is also a shim function that constructs the scheduler based on the provided string. This can be useful if the scheduler you want to use changes often (e.g., specifying the scheduler via a CLI option or config file).
.. automethod:: ray.tune.create_scheduler
+9
View File
@@ -79,6 +79,7 @@ Tune also provides helpful utilities to use with Search Algorithms:
* :ref:`repeater`: Support for running each *sampled hyperparameter* with multiple random seeds.
* :ref:`limiter`: Limits the amount of concurrent trials when running optimization.
* :ref:`shim`: Allows creation of the search algorithm object given a string.
Saving and Restoring
--------------------
@@ -268,3 +269,11 @@ If you are interested in implementing or contributing a new Search Algorithm, pr
:members:
:private-members:
:show-inheritance:
.. _shim:
Shim Instantiation (tune.create_searcher)
-----------------------------------------
There is also a shim function that constructs the search algorithm based on the provided string. This can be useful if the search algorithm you want to use changes often (e.g., specifying the search algorithm via a CLI option or config file).
.. automethod:: ray.tune.create_searcher