deephyper.evaluator.callback.SearchEarlyStopping#

class deephyper.evaluator.callback.SearchEarlyStopping(patience: int = 10, objective_func=<function SearchEarlyStopping.<lambda>>, threshold: float = None, verbose: bool = 1)[source]#

Bases: Callback

Stop the search gracefully when it does not improve for a given number of evaluations.

Parameters:
  • patience (int, optional) – The number of not improving evaluations to wait for before stopping the search. Defaults to 10.

  • objective_func (callable, optional) – A function that takes a Job has input and returns the maximized scalar value monitored by this callback. Defaults to lambda j: j.result.

  • threshold (float, optional) – The threshold to reach before activating the patience to stop the search. Defaults to None, patience is reinitialized after each improving observation.

  • verbose (bool, optional) – Activation or deactivate the verbose mode. Defaults to True.

Methods

on_done

Called each time a Job is completed by the Evaluator.

on_done_other

Called each time a Job is collected from an other process.

on_launch

Called each time a Job is created by the Evaluator.

on_done(job)[source]#

Called each time a Job is completed by the Evaluator.

Parameters:

job (Job) – The completed job.

on_done_other(job)[source]#

Called each time a Job is collected from an other process.

Parameters:

job (Job) – The completed Job.

on_launch(job)#

Called each time a Job is created by the Evaluator.

Parameters:

job (Job) – The created job.