optuna.terminator.BestValueStagnationEvaluator
- class optuna.terminator.BestValueStagnationEvaluator(max_stagnation_trials=30)[源代码]
评估优化过程中最佳值停滞的周期。
此类通过最大停滞周期 (max_stagnation_trials) 初始化,用于评估在达到允许的最大停滞周期之前剩余的 trials 数。如果剩余 trials 数达到零,则 trial 终止。因此,默认的误差评估器是 StaticErrorEvaluator(const=0) 的实例。
- 参数:
max_stagnation_trials (int) – 允许停滞的最大 trials 数。
注意
在 v3.4.0 中作为实验性功能添加。接口在更高版本中可能会更改,恕不另行通知。请参阅 https://github.com/optuna/optuna/releases/tag/v3.4.0。
方法
evaluate
(trials, study_direction)