Skip to main content

is_promotable

Function is_promotable 

pub fn is_promotable(
    competing: &[f64],
    candidate: f64,
    direction: Direction,
    reduction_factor: u32,
) -> bool
Expand description

The asynchronous successive-halving promotion rule.

competing is every value that has reached the rung, including candidate — the value now being judged. The trial is promotable (may continue past the rung) exactly when it is in the top 1/reduction_factor of those values; otherwise it is pruned.

The exact rule (Optuna’s, made direction-aware):

  • promoted = competing.len() / reduction_factor (floored) is how many of the n occupants are promoted.
  • Optimistic bootstrap. When promoted == 0 — fewer than reduction_factor trials have reached the rung — the candidate is promoted. Without this the first reduction_factor − 1 trials to reach a rung would all be pruned and no baseline could ever form.
  • Otherwise the candidate is promoted iff it is at least as good as the promoted-th best value: rank the values best-first, and promote when the candidate is not strictly worse than the one at index promoted − 1.

§NaN

A NaN candidate is never promotable (a diverged run at a rung is pruned). NaN competitors are sorted to the worst end, so they never displace a finite trial from the promotable set.