deephyper.stopper.ConstantStopper#

class deephyper.stopper.ConstantStopper(max_steps: int, stop_step: int)[source]#

Bases: Stopper

Constant stopping policy which will stop the evaluation of a configuration at a fixed step.

Single-Objective

Multi-Objectives

Failures

Parameters:
  • max_steps (int) – The maximum number of steps which should be performed to evaluate the configuration fully.

  • stop_step (int) – The step at which to stop the evaluation.

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 currently observed objective by the maximum objective observed from the start.

Attributes

objective

Last observed objective.

observations

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

step

Last observed step.

property objective#

Last observed objective.

property observations: list#

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

observe(budget: float, objective: float) None#

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 currently observed objective by the maximum objective observed from the start.

By default the identity transformation is used.

Parameters:

objective (float) – the observed objective value.