ray.tune.stopper.ExperimentPlateauStopper#

class ray.tune.stopper.ExperimentPlateauStopper(metric: str, std: float = 0.001, top: int = 10, mode: str = 'min', patience: int = 0)[source]#

Bases: ray.tune.stopper.stopper.Stopper

Early stop the experiment when a metric plateaued across trials.

Stops the entire experiment when the metric has plateaued for more than the given amount of iterations specified in the patience parameter.

Parameters
  • metric – The metric to be monitored.

  • std – The minimal standard deviation after which the tuning process has to stop.

  • top – The number of best models to consider.

  • mode – The mode to select the top results. Can either be β€œmin” or β€œmax”.

  • patience – Number of epochs to wait for a change in the top models.

Raises
  • ValueError – If the mode parameter is not β€œmin” nor β€œmax”.

  • ValueError – If the top parameter is not an integer greater than 1.

  • ValueError – If the standard deviation parameter is not a strictly positive float.

  • ValueError – If the patience parameter is not a strictly positive integer.

PublicAPI: This API is stable across Ray releases.

stop_all()[source]#

Return whether to stop and prevent trials from starting.