syne_tune.stopping_criterion module
- class syne_tune.stopping_criterion.StoppingCriterion(max_wallclock_time=None, max_num_evaluations=None, max_num_trials_started=None, max_num_trials_completed=None, max_cost=None, max_num_trials_finished=None, min_metric_value=None, max_metric_value=None)[source]
Bases:
object
Stopping criterion that can be used in a Tuner, for instance
Tuner(stop_criterion=StoppingCriterion(max_wallclock_time=3600), ...)
.If several arguments are used, the combined criterion is true whenever one of the atomic criteria is true.
In principle,
stop_criterion
forTuner
can be any lambda function, but this class should be used with remote launching in order to ensure proper serialization.- Parameters:
max_wallclock_time (
Optional
[float
]) – Stop once this wallclock time is reachedmax_num_evaluations (
Optional
[int
]) – Stop once more than this number of metric records have been reportedmax_num_trials_started (
Optional
[int
]) – Stop once more than this number of trials have been startedmax_num_trials_completed (
Optional
[int
]) – Stop once more than this number of trials have been completed. This does not include trials which were stopped or failedmax_cost (
Optional
[float
]) – Stop once total cost of evaluations larger than this valuemax_num_trials_finished (
Optional
[int
]) – Stop once more than this number of trials have finished (i.e., completed, stopped, failed, or stopping)min_metric_value (
Optional
[Dict
[str
,float
]]) – Dictionary with thresholds for selected metrics. Stop once an evaluation reports a metric value below a thresholdmax_metric_value (
Optional
[Dict
[str
,float
]]) – Dictionary with thresholds for selected metrics. Stop once an evaluation reports a metric value above a threshold
-
max_wallclock_time:
float
= None
-
max_num_evaluations:
int
= None
-
max_num_trials_started:
int
= None
-
max_num_trials_completed:
int
= None
-
max_cost:
float
= None
-
max_num_trials_finished:
int
= None
-
min_metric_value:
Optional
[Dict
[str
,float
]] = None
-
max_metric_value:
Optional
[Dict
[str
,float
]] = None
- class syne_tune.stopping_criterion.PlateauStopper(metric, std=0.001, num_trials=10, mode='min', patience=0)[source]
Bases:
object
Stops the experiment when a metric plateaued for N consecutive trials for more than the given amount of iterations specified in the patience parameter. This code is inspired by Ray Tune.