deephyper.stopper.SuccessiveHalvingStopper#
- class deephyper.stopper.SuccessiveHalvingStopper(max_steps: int, min_steps: float = 1, reduction_factor: float = 3, min_early_stopping_rate: float = 0, min_competing: int = 0, min_fully_completed=0, epsilon=1e-10)[source]#
Bases:
Stopper
Stopper based on the Asynchronous Successive Halving algorithm (ASHA).
Single-Objective
Multi-Objectives
Failures
✅
❌
✅
The Successive Halving (SHA) was proposed in Non-stochastic Best Arm IdentiÞcation and Hyperparameter Optimization in the context of a fixed number of hyperparameter configurations. The SHA algorithm was synchronous at the time and therefore not efficient when using parallel ressources. The Sucessive Halving algorithm was then extended to be asynchronous in A System for Massively Parallel Hyperparameter Tuning.
Halving is a technique to reduce the number of configurations to evaluate by a factor of
reduction_factor
. The halving schedule is following a geometric progression. The first halving step is done aftermin_steps
steps. The next halving step is done aftermin_steps * reduction_factor
steps. The next halving step is done aftermin_steps * reduction_factor^2
steps. And so on.- Parameters:
max_steps (int) – The maximum number of steps to run the evaluation (e.g., number of epochs).
min_steps (float, optional) – The minimum number of steps to run the evaluation. Defaults to 1.
reduction_factor (float, optional) – At each halving step the current model is kept only if among the top-``1/reduction_factor*100``%. Defaults to 3.
min_early_stopping_rate (float, optional) – A parameter to delay the halving schedule. Defaults to 0.
min_competing (int, optional) – The minimum number of competitors necessary to check the top-k condition. Defaults to 0.
min_fully_completed (int, optional) – The minimum number of evaluation evaluated with
max_steps
. Defaults to 1.
Methods
Observe a new objective value.
Returns
True
if the evaluation should be stopped andFalse
otherwise.Returns a dict version of the stopper which can be saved as JSON.
Replaces the currently observed objective by the maximum objective observed from the start.
Attributes
Last observed objective.
Returns a copy of the list of observations with 0-index the budgets and 1-index the objectives.
Last observed step.
- property objective#
Last observed objective.
- property observations: list#
Returns a copy of the list of observations with 0-index the budgets and 1-index the objectives.
- property step#
Last observed step.
- stop() bool [source]#
Returns
True
if the evaluation should be stopped andFalse
otherwise.- Returns:
(step >= max_steps)
.- Return type:
- to_json()#
Returns a dict version of the stopper which can be saved as JSON.