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 after min_steps steps. The next halving step is done after min_steps * reduction_factor steps. The next halving step is done after min_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

Observe a new objective value.

stop

Returns True if the evaluation should be stopped and False otherwise.

to_json

Returns a dict version of the stopper which can be saved as JSON.

transform_objective

Replaces the currently observed objective by the maximum objective observed from the start.

Attributes

objective

Last observed objective.

observations

Returns a copy of the list of observations with 0-index the budgets and 1-index the objectives.

step

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.

observe(budget: float, objective: float)[source]#

Observe a new objective value.

Parameters:
  • budget (float) – the budget used to obtain the objective (e.g., the number of epochs).

  • objective (float) – the objective value to observe (e.g, the accuracy).

property step#

Last observed step.

stop() bool[source]#

Returns True if the evaluation should be stopped and False otherwise.

Returns:

(step >= max_steps).

Return type:

bool

to_json()#

Returns a dict version of the stopper which can be saved as JSON.

transform_objective(objective: float)#

Replaces the currently observed objective by the maximum objective observed from the start. Identity transformation by default.