[tune] Tweaks to Trainable and Verbosity (#2889)

This commit is contained in:
Richard Liaw
2018-10-11 23:42:13 -07:00
committed by GitHub
parent 828fe24b39
commit f9b58d7b02
17 changed files with 160 additions and 47 deletions
+4 -2
View File
@@ -25,10 +25,13 @@ By default, Tune uses the `default search space and variant generation process <
:noindex:
Note that other search algorithms will not necessarily extend this class and may require a different search space declaration than the default Tune format.
HyperOpt Search (Tree-structured Parzen Estimators)
---------------------------------------------------
The ``HyperOptSearch`` is a SearchAlgorithm that is backed by `HyperOpt <http://hyperopt.github.io/hyperopt>`__ to perform sequential model-based hyperparameter optimization.
The ``HyperOptSearch`` is a SearchAlgorithm that is backed by `HyperOpt <http://hyperopt.github.io/hyperopt>`__ to perform sequential model-based hyperparameter optimization. Note that this class does not extend ``ray.tune.suggest.BasicVariantGenerator``, so you will not be able to use Tune's default variant generation/search space declaration when using HyperOptSearch.
In order to use this search algorithm, you will need to install HyperOpt via the following command:
.. code-block:: bash
@@ -47,7 +50,6 @@ An example of this can be found in `hyperopt_example.py <https://github.com/ray-
:show-inheritance:
:noindex:
Contributing a New Algorithm
----------------------------
+3 -3
View File
@@ -134,6 +134,9 @@ Tune Search Space (Default)
You can use ``tune.grid_search`` to specify an axis of a grid search. By default, Tune also supports sampling parameters from user-specified lambda functions, which can be used independently or in combination with grid search.
.. note::
If you specify an explicit Search Algorithm such as any SuggestionAlgorithm, you may not be able to specify lambdas or grid search with this interface, as the search algorithm may require a different search space declaration.
The following shows grid search over two nested parameters combined with random sampling from two lambda functions, generating 9 different trials. Note that the value of ``beta`` depends on the value of ``alpha``, which is represented by referencing ``spec.config.alpha`` in the lambda function. This lets you specify conditional parameter distributions.
.. code-block:: python
@@ -157,9 +160,6 @@ The following shows grid search over two nested parameters combined with random
.. note::
Lambda functions will be evaluated during trial variant generation. If you need to pass a literal function in your config, use ``tune.function(...)`` to escape it.
.. warning::
If you specify a Search Algorithm, you may not be able to use this feature, as the algorithm may require a different search space declaration.
For more information on variant generation, see `basic_variant.py <https://github.com/ray-project/ray/blob/master/python/ray/tune/suggest/basic_variant.py>`__.
Sampling Multiple Times