on_trial_result#
- MedianStoppingRule.on_trial_result(tune_controller: TuneController, trial: Trial, result: Dict) str[source]#
Callback for early stopping.
Let
tbe this result’s value oftime_attr. Oncetreachesgrace_period, the rule compares the trial against every other trial that has already reported a result attor later, whether it’s still running or finished. For each of those trials, it averages the metric over the results reported betweengrace_periodandt. If the trial’s best metric value so far is strictly worse than the median of those averages, the rule stops the trial.- Parameters:
- Returns:
TrialScheduler.STOPto stop the trial early, orTrialScheduler.PAUSEinstead whenhard_stopis False. When too few other trials have reachedtto compare against,TrialScheduler.PAUSEif more thanmin_time_slicehas passed since the trial last paused and other trials are waiting to run. OtherwiseTrialScheduler.CONTINUE.- Return type: