Population Based Training ========================= Ray Tune includes a distributed implementation of `Population Based Training (PBT) `__. PBT Scheduler ------------- Ray Tune's PBT scheduler can be plugged in on top of an existing grid or random search experiment. This can be enabled by setting the ``scheduler`` parameter of ``run_experiments``, e.g. .. code-block:: python run_experiments( {...}, scheduler=PopulationBasedTraining( time_attr='time_total_s', reward_attr='mean_accuracy', perturbation_interval=600.0, hyperparam_mutations={ "lr": [1e-3, 5e-4, 1e-4, 5e-5, 1e-5], "alpha": lambda: random.uniform(0.0, 1.0), ... })) 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 `checkpointing `__). 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 `__ 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 discovering new hyperparams over the course of a single experiment: .. image:: pbt.png .. autoclass:: ray.tune.pbt.PopulationBasedTraining