Enum SamplerKind
pub enum SamplerKind {
Random,
Sobol,
Tpe,
Gp,
Cmaes,
Auto,
}Expand description
Which built-in sampler to run.
Variants§
Random
Uniform independent sampling — the baseline every other sampler must beat.
Sobol
The Sobol low-discrepancy (quasi-Monte-Carlo) sequence.
Tpe
The Tree-structured Parzen Estimator, the learning sampler.
Gp
The M6.2 in-house Gaussian-process sampler with the numerically stable
logEI acquisition (GpEi, the facade’s gp feature).
Cmaes
The M4.3 in-house CMA-ES sampler (Cmaes, the facade’s cmaes
feature) — the continuous specialist whose adapted covariance handles
ill-conditioned, rotated valleys.
Auto
The M6.7 rule-based picker: the sampler atune::auto_sampler() chooses
for the study’s shape and budget.
Not a sampler but a decision, so unlike every other kind it needs
context — see build_for.
§It can resolve to a sampler this enum does not name
Rule 3 picks Grid on a finite space of at
most 256 points the declared budget can enumerate, and rule 1 picks
Nsga2 on a multi-objective study (see the
module docs). Grid is the consequential one: it reports
SpaceExhausted once it has handed
out every point, which atune’s own study loop treats as a normal stop but
kurobako has no message for. The adapter therefore substitutes uniform
Random for the rest of that study rather than fail the whole
benchmark run, so an atune-auto score on a small finite domain can be a
mixture of auto’s pick and random search — the
kurobako module docs record the trade-off and the
stderr line that announces it.
Implementations§
§impl SamplerKind
impl SamplerKind
pub const FRONTIER: [Self; 3]
pub const FRONTIER: [Self; 3]
The frontier kinds, in a fixed order — the M6 arms reachable from
atune-solver --sampler but outside the in-tree quality gate (see the
module docs for why).
pub const ALL_KINDS: [Self; 6]
pub const ALL_KINDS: [Self; 6]
Every kind, gate arms first then frontier arms — the exhaustive list, for a caller that wants all of them (label round-trips, CLI help, a construction smoke test).
Deliberately not ALL: that array’s contents are the M2.3
gate’s contract, and widening it would quietly change what the gate
measures.
pub const fn label(self) -> &'static str
pub const fn label(self) -> &'static str
The lowercase flag label (random, sobol, tpe, gp, cmaes,
auto).
pub fn parse(label: &str) -> Result<Self, String>
pub fn parse(label: &str) -> Result<Self, String>
Parses a flag label, accepting qmc as an alias of sobol.
§Errors
Returns the unrecognized label so a caller can report it.
pub fn build(self) -> Arc<dyn Sampler> ⓘ
pub fn build(self) -> Arc<dyn Sampler> ⓘ
Builds a fresh boxed sampler of this kind, without a study context.
Every kind except Auto is a fixed sampler, so this is the
whole answer. Auto is a function of the study’s shape
and budget, which this signature cannot supply; rather than invent a
second rule ladder it asks atune::auto_sampler() about the degenerate
study — an empty space, an unbounded budget — whose documented answer is
uniform Random. Any caller that knows the space (the kurobako
adapter does, from the problem’s parameter domain) must use
build_for instead, or auto silently degrades to
the baseline.
pub fn build_for(
self,
space: &SpaceSchema,
budget: &Budget,
directions: &[Direction],
) -> Arc<dyn Sampler> ⓘ
pub fn build_for( self, space: &SpaceSchema, budget: &Budget, directions: &[Direction], ) -> Arc<dyn Sampler> ⓘ
Builds a fresh boxed sampler of this kind for a study of this shape.
Only Auto reads the arguments — it is exactly
atune::auto_sampler(), whose pick is a pure function of
(space, budget, directions) with no RNG or ambient state
(docs/design/09-implementation.md §5). Every other kind names its sampler
outright and ignores them, so passing an approximate budget costs
nothing except an auto pick.
Trait Implementations§
§impl Clone for SamplerKind
impl Clone for SamplerKind
§fn clone(&self) -> SamplerKind
fn clone(&self) -> SamplerKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SamplerKind
§impl Debug for SamplerKind
impl Debug for SamplerKind
impl Eq for SamplerKind
§impl PartialEq for SamplerKind
impl PartialEq for SamplerKind
impl StructuralPartialEq for SamplerKind
Auto Trait Implementations§
impl Freeze for SamplerKind
impl RefUnwindSafe for SamplerKind
impl Send for SamplerKind
impl Sync for SamplerKind
impl Unpin for SamplerKind
impl UnsafeUnpin for SamplerKind
impl UnwindSafe for SamplerKind
Blanket Implementations§
impl<T> Boilerplate for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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