syne_tune.optimizer.schedulers.median_stopping_rule module
- class syne_tune.optimizer.schedulers.median_stopping_rule.MedianStoppingRule(scheduler, resource_attr, running_average=True, metric=None, grace_time=1, grace_population=5, rank_cutoff=0.5)[source]
Bases:
TrialScheduler
Applies median stopping rule in top of an existing scheduler.
If result at time-step ranks less than the cutoff of other results observed at this time-step, the trial is interrupted and otherwise, the wrapped scheduler is called to make the stopping decision.
Suggest decisions are left to the wrapped scheduler.
The mode of the wrapped scheduler is used.
Reference:
Google Vizier: A Service for Black-Box Optimization.Golovin et al. 2017.Proceedings of the 23rd ACM SIGKDD International Conference on KnowledgeDiscovery and Data Mining, August 2017Pages 1487–1495- Parameters:
scheduler (
TrialScheduler
) – Scheduler to be called for trial suggestion or when median-stopping-rule decision is to continue.resource_attr (
str
) – Key in the reported dictionary that accounts for the resource (e.g. epoch).running_average (
bool
) – IfTrue
, then uses the running average of observation instead of raw observations. Defaults toTrue
metric (
Optional
[str
]) – Metric to be considered, defaults toscheduler.metric
grace_time (
Optional
[int
]) – Median stopping rule is only applied for results whoseresource_attr
exceeds this amount. Defaults to 1grace_population (
int
) – Median stopping rule when at leastgrace_population
have been observed at a resource level. Defaults to 5rank_cutoff (
float
) – Results whose quantiles are below this level are discarded. Defaults to 0.5 (median)
- on_trial_result(trial, result)[source]
Called on each intermediate result reported by a trial.
At this point, the trial scheduler can make a decision by returning one of
SchedulerDecision.CONTINUE
,SchedulerDecision.PAUSE
, orSchedulerDecision.STOP
. This will only be called when the trial is currently running.- Parameters:
trial (
Trial
) – Trial for which results are reportedresult (
Dict
) – Result dictionary
- Return type:
str
- Returns:
Decision what to do with the trial
- grace_condition(time_step)[source]
- Parameters:
time_step (
float
) – Valueresult[self.resource_attr]
- Return type:
bool
- Returns:
Decide for continue?