on_trial_result#

MedianStoppingRule.on_trial_result(tune_controller: TuneController, trial: Trial, result: Dict) → str[source]#

Callback for early stopping.

Let t be this result’s value of time_attr. Once t reaches grace_period, the rule compares the trial against every other trial that has already reported a result at t or later, whether it’s still running or finished. For each of those trials, it averages the metric over the results reported between grace_period and t. If the trial’s best metric value so far is strictly worse than the median of those averages, the rule stops the trial.

Parameters:
  • tune_controller (TuneController) – The controller running the experiment.

  • trial (Trial) – The trial that reported the result.

  • result (Dict) – The result the trial reported.

Returns:

TrialScheduler.STOP to stop the trial early, or TrialScheduler.PAUSE instead when hard_stop is False. When too few other trials have reached t to compare against, TrialScheduler.PAUSE if more than min_time_slice has passed since the trial last paused and other trials are waiting to run. Otherwise TrialScheduler.CONTINUE.

Return type:

str