pub enum SearchStrategy {
Grid,
Random {
budget: usize,
seed: u64,
max_wall_secs: Option<u64>,
},
Bayesian {
budget: usize,
warmup: usize,
gamma: f64,
seed: u64,
max_wall_secs: Option<u64>,
},
}Expand description
Which enumeration to use over the SearchSpace.
Variants§
Grid
Exhaustive Cartesian-product enumeration. Cost scales with the
grid cardinality — see SearchSpace::grid_cardinality.
Random
Uniform random sampling for budget trials.
Fields
Bayesian
Sequential Bayesian-ish search. After warmup uniform random
trials, subsequent trials pick each knob’s value by the ratio of
per-value probabilities between the top-gamma-fraction trials
(“good”) and the bottom 1 − gamma (“bad”). This is an
axis-parallel TPE-lite acquisition: independent across knobs,
Laplace-smoothed, reproducible under a fixed seed.
Trades a constant-factor more code for meaningful sample efficiency versus uniform random — typical win on our default space is ~30% fewer trials to reach the random-search ceiling.
Fields
warmup: usizeInitial uniform random trials before the acquisition kicks in. Must be ≥ 2 so the “good” / “bad” split is non-degenerate.
gamma: f64Fraction of past trials treated as “good” when fitting the acquisition. 0.25 is the TPE default; smaller = more exploit, larger = more explore.
max_wall_secs: Option<u64>Optional wall-time cap in seconds. Same semantics as
Self::Random::max_wall_secs.
Trait Implementations§
Source§impl Clone for SearchStrategy
impl Clone for SearchStrategy
Source§fn clone(&self) -> SearchStrategy
fn clone(&self) -> SearchStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SearchStrategy
impl RefUnwindSafe for SearchStrategy
impl Send for SearchStrategy
impl Sync for SearchStrategy
impl Unpin for SearchStrategy
impl UnsafeUnpin for SearchStrategy
impl UnwindSafe for SearchStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more