Struct HyperbandPruner
pub struct HyperbandPruner { /* private fields */ }Expand description
Asynchronous Hyperband: a fan of AshaPruner brackets over one ladder.
§The bracket schedule
From (min_resource, max_resource, reduction_factor η) the number of
brackets is s_max + 1, where s_max = floor(log_η(max / min)) is the most
aggressive bracket whose first rung still fits under the maximum. Bracket s
is an AshaPruner over the sub-ladder starting at min · ηˢ:
Bracket s | First rung | Character |
|---|---|---|
0 | min | most rungs — aggressive early stopping, exploration |
| … | min · ηˢ | fewer rungs |
s_max | min · η^{s_max} | one rung near the top — little pruning, exploitation |
§Bracket assignment
bracket_of(study, trial_number, n_brackets) —
crc32(study ‖ trial_number) mod n_brackets. It is a pure function of
identifiers every worker already has, so no bracket-assignment table is
shared or persisted: two processes place the same trial in the same bracket
by computing it, never by coordinating.
§Promotion within a bracket
Identical to AshaPruner, with the rung’s occupants filtered to the trials
in the same bracket (each trial’s bracket is recomputed with the same pure
function). A multi-objective study is never pruned; NaN at a rung is pruned.
§Determinism
Bracket assignment is pre-determined (a pure function of (study, number)),
but the promotion decision, like AshaPruner’s, reads the ask-time
StudyView and so depends on which same-bracket trials had filled the rung
— replayable, not pre-determined, under parallelism (where determinism
stops).
Single-worker with a fixed seed is fully reproducible.
use atune_core::scheduler::HyperbandPruner;
// η = 3, from 1 to 27: brackets start at 1, 3, 9, 27 -> 4 brackets.
let hb = HyperbandPruner::new(1, 27, 3)?;
assert_eq!(hb.brackets(), 4);Implementations§
§impl HyperbandPruner
impl HyperbandPruner
pub fn new(
min_resource: u64,
max_resource: u64,
reduction_factor: u32,
) -> Result<Self>
pub fn new( min_resource: u64, max_resource: u64, reduction_factor: u32, ) -> Result<Self>
Builds a Hyperband pruner over (min_resource, max_resource, reduction_factor).
§Errors
Error::InvalidSpace for a nonsense
ladder — see RungLadder::new.
pub fn with_default_eta(min_resource: u64, max_resource: u64) -> Result<Self>
pub fn with_default_eta(min_resource: u64, max_resource: u64) -> Result<Self>
pub fn with_objective(self, obj: usize) -> Self
pub fn with_objective(self, obj: usize) -> Self
Selects which objective dimension to gate on (default 0), propagating it
to every bracket.
pub const fn min_resource(&self) -> u64
pub const fn min_resource(&self) -> u64
The first rung’s resource.
pub const fn max_resource(&self) -> u64
pub const fn max_resource(&self) -> u64
The finish line.
pub const fn reduction_factor(&self) -> u32
pub const fn reduction_factor(&self) -> u32
The geometric factor η.
pub fn bracket_for(&self, view: &StudyView, number: TrialNumber) -> u32
pub fn bracket_for(&self, view: &StudyView, number: TrialNumber) -> u32
The bracket a trial is assigned to.
Trait Implementations§
§impl Clone for HyperbandPruner
impl Clone for HyperbandPruner
§fn clone(&self) -> HyperbandPruner
fn clone(&self) -> HyperbandPruner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for HyperbandPruner
impl Debug for HyperbandPruner
§impl Scheduler for HyperbandPruner
impl Scheduler for HyperbandPruner
§fn on_report(
&self,
study: &StudyView,
trial: &TrialMeta,
step: u64,
values: &[f64],
) -> Result<Decision>
fn on_report( &self, study: &StudyView, trial: &TrialMeta, step: u64, values: &[f64], ) -> Result<Decision>
§fn state(&self) -> Result<Option<SchedulerState>>
fn state(&self) -> Result<Option<SchedulerState>>
None: bracket assignment is a pure function and rung tables are derived
from the StudyView — nothing to persist.