[tune] Put examples under proper version control (#9427)

Co-authored-by: krfricke <krfricke@users.noreply.github.com>
This commit is contained in:
Richard Liaw
2020-07-13 18:01:10 -07:00
committed by GitHub
co-authored by krfricke
parent 7abf7a0109
commit a567f7977c
32 changed files with 199 additions and 41 deletions
+2 -2
View File
@@ -58,7 +58,7 @@ You can then pass in your own logger as follows:
These loggers will be called along with the default Tune loggers. You can also check out `logger.py <https://github.com/ray-project/ray/blob/master/python/ray/tune/logger.py>`__ for implementation details.
An example of creating a custom logger can be found in `logging_example.py <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/logging_example.py>`__.
An example of creating a custom logger can be found in :doc:`/tune/examples/logging_example`.
.. _trainable-logging:
@@ -164,7 +164,7 @@ CSVLogger
MLFLowLogger
------------
Tune also provides a default logger for `MLFlow <https://mlflow.org>`_. You can install MLFlow via ``pip install mlflow``. An example can be found `mlflow_example.py <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/mlflow_example.py>`__. Note that this currently does not include artifact logging support. For this, you can use the native MLFlow APIs inside your Trainable definition.
Tune also provides a default logger for `MLFlow <https://mlflow.org>`_. You can install MLFlow via ``pip install mlflow``. An example can be found in :doc:`/tune/examples/mlflow_example`. Note that this currently does not include artifact logging support. For this, you can use the native MLFlow APIs inside your Trainable definition.
.. autoclass:: ray.tune.logger.MLFLowLogger
+7 -7
View File
@@ -32,7 +32,7 @@ When using schedulers, you may face compatibility issues, as shown in the below
* - :ref:`ASHA <tune-scheduler-hyperband>`
- No
- Yes
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/async_hyperband_example.py>`__
- :doc:`Link </tune/examples/async_hyperband_example>`
* - :ref:`Median Stopping Rule <tune-scheduler-msr>`
- No
- Yes
@@ -40,15 +40,15 @@ When using schedulers, you may face compatibility issues, as shown in the below
* - :ref:`HyperBand <tune-original-hyperband>`
- Yes
- Yes
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/hyperband_example.py>`__
- :doc:`Link </tune/examples/hyperband_example>`
* - :ref:`BOHB <tune-scheduler-bohb>`
- Yes
- Only TuneBOHB
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/bohb_example.py>`__
- :doc:`Link </tune/examples/bohb_example>`
* - :ref:`Population Based Training <tune-scheduler-pbt>`
- Yes
- Not Compatible
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/pbt_example.py>`__
- :doc:`Link </tune/examples/pbt_example>`
.. _tune-scheduler-hyperband:
@@ -69,7 +69,7 @@ The `ASHA <https://openreview.net/forum?id=S1Y7OOlRZ>`__ scheduler can be used b
brackets=1)
tune.run( ... , scheduler=asha_scheduler)
Compared to the original version of HyperBand, this implementation provides better parallelism and avoids straggler issues during eliminations. **We recommend using this over the standard HyperBand scheduler.** An example of this can be `found here <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/async_hyperband_example.py>`_.
Compared to the original version of HyperBand, this implementation provides better parallelism and avoids straggler issues during eliminations. **We recommend using this over the standard HyperBand scheduler.** An example of this can be found here: :doc:`/tune/examples/async_hyperband_example`.
Even though the original paper mentions a bracket count of 3, discussions with the authors concluded that the value should be left to 1 bracket. This is the default used if no value is provided for the ``brackets`` argument.
@@ -141,7 +141,7 @@ Tune includes a distributed implementation of `Population Based Training (PBT) <
When the PBT scheduler is enabled, each trial variant is treated as a member of the population. Periodically, top-performing trials are checkpointed (this requires your Trainable to support :ref:`save and restore <tune-checkpoint>`). Low-performing trials clone the checkpoints of top performers and perturb the configurations in the hope of discovering an even better variation.
You can run this `toy PBT example <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/pbt_example.py>`__ to get an idea of how how PBT operates. When training in PBT mode, a single trial may see many different hyperparameters over its lifetime, which is recorded in its ``result.json`` file. The following figure generated by the example shows PBT with optimizing a LR schedule over the course of a single experiment:
You can run this :doc:`toy PBT example </tune/examples/pbt_function>` to get an idea of how how PBT operates. When training in PBT mode, a single trial may see many different hyperparameters over its lifetime, which is recorded in its ``result.json`` file. The following figure generated by the example shows PBT with optimizing a LR schedule over the course of a single experiment:
.. image:: /pbt.png
@@ -157,7 +157,7 @@ This class is a variant of HyperBand that enables the `BOHB Algorithm <https://a
This is to be used in conjunction with the Tune BOHB search algorithm. See :ref:`TuneBOHB <suggest-TuneBOHB>` for package requirements, examples, and details.
An example of this in use can be found in `bohb_example.py <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/bohb_example.py>`_.
An example of this in use can be found here: :doc:`/tune/examples/bohb_example`.
.. autoclass:: ray.tune.schedulers.HyperBandForBOHB
+9 -9
View File
@@ -25,39 +25,39 @@ Summary
* - :ref:`AxSearch <tune-ax>`
- Bayesian/Bandit Optimization
- [`Ax <https://ax.dev/>`__]
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/ax_example.py>`__
- :doc:`/tune/examples/ax_example`
* - :ref:`DragonflySearch <Dragonfly>`
- Scalable Bayesian Optimization
- [`Dragonfly <https://dragonfly-opt.readthedocs.io/>`__]
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/dragonfly_example.py>`__
- :doc:`/tune/examples/dragonfly_example`
* - :ref:`SkoptSearch <skopt>`
- Bayesian Optimization
- [`Scikit-Optimize <https://scikit-optimize.github.io>`__]
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/skopt_example.py>`__
- :doc:`/tune/examples/skopt_example`
* - :ref:`HyperOptSearch <tune-hyperopt>`
- Tree-Parzen Estimators
- [`HyperOpt <http://hyperopt.github.io/hyperopt>`__]
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/hyperopt_example.py>`__
- :doc:`/tune/examples/hyperopt_example`
* - :ref:`BayesOptSearch <bayesopt>`
- Bayesian Optimization
- [`BayesianOptimization <https://github.com/fmfn/BayesianOptimization>`__]
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/bayesopt_example.py>`__
- :doc:`/tune/examples/bayesopt_example`
* - :ref:`TuneBOHB <suggest-TuneBOHB>`
- Bayesian Opt/HyperBand
- [`BOHB <https://github.com/automl/HpBandSter>`__]
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/bohb_example.py>`__
- :doc:`/tune/examples/bohb_example`
* - :ref:`NevergradSearch <nevergrad>`
- Gradient-free Optimization
- [`Nevergrad <https://github.com/facebookresearch/nevergrad>`__]
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/nevergrad_example.py>`__
- :doc:`/tune/examples/nevergrad_example`
* - :ref:`ZOOptSearch <zoopt>`
- Zeroth-order Optimization
- [`ZOOpt <https://github.com/polixir/ZOOpt>`__]
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/zoopt_example.py>`__
- :doc:`/tune/examples/zoopt_example`
* - :ref:`SigOptSearch <sigopt>`
- Closed source
- [`SigOpt <https://sigopt.com/>`__]
- `Link <https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/sigopt_example.py>`__
- :doc:`/tune/examples/sigopt_example`
.. note::Search algorithms will require a different search space declaration than the default Tune format - meaning that you will not be able to combine ``tune.grid_search`` with the below integrations.