Pruner using the median stopping rule.
Prune if the trial’s best intermediate result is worse than median of intermediate results of previous trials at the same step.
We minimize an objective function with the median stopping rule.
>>> from optuna import create_study >>> from optuna.pruners import MedianPruner >>> >>> def objective(trial): >>> ... >>> >>> study = create_study(pruner=MedianPruner()) >>> study.optimize(objective)
- n_startup_trials – Pruning is disabled until the given number of trials finish in the same study.
- n_warmup_steps – Pruning is disabled until the trial reaches the given number of step.
SuccessiveHalvingPruner(min_resource=1, reduction_factor=4, min_early_stopping_rate=0)¶
Pruner using Asynchronous Successive Halving Algorithm.
Successive Halving is a bandit-based algorithm to identify the best one among multiple configurations. This class implements an asynchronous version of Successive Halving. Please refer to the paper of Asynchronous Successive Halving for detailed descriptions.
Note that, this class does not take care of the parameter for the maximum resource, referred to as
Rin the paper. The maximum resource allocated to a trial is typically limited inside the objective function (e.g.,
stepnumber in simple.py,
EPOCHnumber in chainer_integration.py).
We minimize an objective function with
>>> from optuna import create_study >>> from optuna.pruners import SuccessiveHalvingPruner >>> >>> def objective(trial): >>> ... >>> >>> study = create_study(pruner=SuccessiveHalvingPruner()) >>> study.optimize(objective)
- min_resource –
A parameter for specifying the minimum resource allocated to a trial (in the paper this parameter is referred to as
A trial is never pruned until it executes
min_resource * (reduction_factor ** min_early_stopping_rate)steps (i.e., the completion point of the first rung). When the trial completes the first rung, it will be promoted to the next rung only if the value of the trial is placed in the top
1/reduction_factorfraction of the all trials that already have reached the point (otherwise it will be pruned there). If the trial won the competition, it runs until the next completion point (i.e.,
min_resource * (reduction_factor ** (min_early_stopping_rate + rung))steps) and repeats the same procedure.
- reduction_factor –
A parameter for specifying reduction factor of promotable trials (in the paper this parameter is referred to as
eta). At the completion point of each rung, about
1/reduction_factortrials will be promoted.
- min_early_stopping_rate –
A parameter for specifying the minimum early-stopping rate (in the paper this parameter is referred to as
- min_resource –