deephyper.evaluator.callback.SearchEarlyStopping#

class deephyper.evaluator.callback.SearchEarlyStopping(patience: int = 10, objective_func=None, 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 computes the maximum for single-objective optimization and the hypervolume for multi-objective optimization.

  • 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_close

Called when the evaluator is being closed.

on_done

Called when a local job has been gathered.

on_done_other

Called after gathering local jobs on available remote jobs that are done.

on_gather

Called after gathering jobs.

on_launch

Called each time a Job is created by the Evaluator.

on_close()#

Called when the evaluator is being closed.

on_done(job)[source]#

Called when a local job has been gathered.

on_done_other(job)[source]#

Called after gathering local jobs on available remote jobs that are done.

on_gather(local_jobs: List[Job], other_jobs: List[Job])#

Called after gathering jobs.

Parameters:
  • local_jobs (List[Job]) – gathered jobs from local evaluator instance.

  • other_jobs (List[Job]) – gathered jobs from other evaluators using the same storage.

on_launch(job: Job)#

Called each time a Job is created by the Evaluator.

Parameters:

job (Job) – The created job.