Struct MultiFidelity
pub struct MultiFidelity { /* private fields */ }Expand description
A standard synthetic surface plus a cheap, correlated low-fidelity proxy.
See the module documentation for the model. Build one with
MultiFidelity::bowl (smooth, unimodal) or MultiFidelity::rugged
(multimodal), and read its ladder with
fidelities.
Implementations§
§impl MultiFidelity
impl MultiFidelity
pub fn new(
base: Problem,
min_fidelity: u64,
max_fidelity: u64,
bias: f64,
noise: f64,
) -> Result<Self>
pub fn new( base: Problem, min_fidelity: u64, max_fidelity: u64, bias: f64, noise: f64, ) -> Result<Self>
Builds a multi-fidelity problem over base.
bias is the amplitude of the displaced proxy bowl and noise the
amplitude of the per-evaluation wobble; both are scaled by
decay and vanish at the top fidelity.
§Errors
Error::InvalidSpace if base‘s
schema is malformed (the built-in problems’ never are) or the ladder is
degenerate (min_fidelity zero, or not below max_fidelity).
pub fn bowl() -> Result<Self>
pub fn bowl() -> Result<Self>
The smooth bowl fixture: a 4-D sphere over the 1 → 9 ladder.
The canonical separator — if a sampler cannot beat random here, nothing
else it does matters (Problem::sphere). The bias amplitude (120,
against a true range of ~105) is deliberately large: it puts the
among-the-good-configs rank correlation near 0.67, so the cheap
evaluations are genuinely informative and genuinely misleading, and no
searcher can simply read the answer off the bottom rung.
§Errors
As new; never in practice.
pub fn rugged() -> Result<Self>
pub fn rugged() -> Result<Self>
The multimodal fixture: a 3-D Rastrigin over the 1 → 9 ladder.
A grid of local minima inside a smooth global bowl (Problem::rastrigin),
so the cheap proxy is not merely a shifted bowl but a shifted bowl over a
rugged surface — the honest counterpart to bowl.
§Errors
As new; never in practice.
pub fn wide_bowl() -> Result<Self>
pub fn wide_bowl() -> Result<Self>
The wide-ladder fixture: the same 4-D sphere over 1 → 27, so the
cheapest rung costs a twenty-seventh of a full evaluation.
Four fidelities instead of three — a full Hyperband cycle costs 405
units here against 72 on bowl, so the DE sees
far fewer generations per unit budget. It exists to show the result is not
an artefact of one ladder shape.
§Errors
As new; never in practice.
pub const fn schema(&self) -> &SpaceSchema
pub const fn schema(&self) -> &SpaceSchema
The declared search space.
pub const fn min_fidelity(&self) -> u64
pub const fn min_fidelity(&self) -> u64
The cheapest fidelity on the ladder.
pub const fn max_fidelity(&self) -> u64
pub const fn max_fidelity(&self) -> u64
The full budget — the fidelity at which an observation is exact.
pub fn fidelities(&self) -> Result<Vec<u64>>
pub fn fidelities(&self) -> Result<Vec<u64>>
pub fn true_value(&self, point: &Assignment) -> f64
pub fn true_value(&self, point: &Assignment) -> f64
The true (full-fidelity) objective at point — the ground truth every
report is scored against.
pub fn decay(&self, fidelity: u64) -> f64
pub fn decay(&self, fidelity: u64) -> f64
How much of the low-fidelity error survives at fidelity b:
(b_max/b − 1) / (b_max/b_min − 1), clamped to [0, 1].
1 at the cheapest fidelity, 0 exactly at the full budget, and — being
a 1/b curve — mostly burned off one rung below the top. This is the
standard shape of a learning curve’s remaining error, which is what a
fidelity is.
pub fn observe(&self, point: &Assignment, fidelity: u64, seed: u64) -> f64
pub fn observe(&self, point: &Assignment, fidelity: u64, seed: u64) -> f64
What a run of point at fidelity fidelity reports.
f(x) + decay(b)·(bias(x) + noise·wobble): exact at the full budget,
biased and wobbly below it. Pure and total — a malformed assignment yields
NaN through Problem::eval rather than panicking.
pub fn rank_correlation(&self, fidelity: u64, samples: usize, seed: u64) -> f64
pub fn rank_correlation(&self, fidelity: u64, samples: usize, seed: u64) -> f64
Spearman rank correlation between what a run sees at fidelity and the
truth, over samples uniform draws — how informative the cheap proxy
is.
1.0 would mean the low fidelity ranks configurations exactly as the full
budget does (a fixture that hands multi-fidelity search a free win); 0.0
would mean the cheap evaluations are noise (nothing to exploit). A real
problem sits in between, and the oracle pins the band.
pub fn rank_correlation_top(
&self,
fidelity: u64,
samples: usize,
seed: u64,
fraction: f64,
) -> f64
pub fn rank_correlation_top( &self, fidelity: u64, samples: usize, seed: u64, fraction: f64, ) -> f64
The same correlation restricted to the best fraction of the sample by
true value — how informative the cheap proxy is among configurations
that are already good, which is the regime a search spends its budget in.
Always lower than the global rank_correlation:
once the true values are close together, the proxy’s displaced bowl
dominates the ordering. This is the number that says the fixture is not
handing multi-fidelity search a free win.
Trait Implementations§
§impl Clone for MultiFidelity
impl Clone for MultiFidelity
§fn clone(&self) -> MultiFidelity
fn clone(&self) -> MultiFidelity
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 MultiFidelity
impl RefUnwindSafe for MultiFidelity
impl Send for MultiFidelity
impl Sync for MultiFidelity
impl Unpin for MultiFidelity
impl UnsafeUnpin for MultiFidelity
impl UnwindSafe for MultiFidelity
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
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