Skip to main content

LearningCurve

Enum LearningCurve 

pub enum LearningCurve {
    Saturating {
        asymptote: f64,
        rate: f64,
        floor: f64,
        noise: f64,
    },
    Table {
        points: Vec<(u64, f64)>,
    },
}
Expand description

A synthetic learning curve: a deterministic value at each resource step.

Build one with a named constructor and read it with value_at. Every constructor is const-friendly data, and the value is a pure function of the step (and, for the noisy family, a seed), so a curve is trivially reproducible and cheap to evaluate inside the objective’s inner loop.

Variants§

§

Saturating

The monotone-saturating trend floor + (asymptote − floor)·(1 − e^(−rate·t)), plus deterministic noise of amplitude noise (zero for a smooth curve).

rate controls how fast the curve approaches asymptote: large rate saturates almost immediately (a fast learner), small rate climbs slowly (a slow starter). With asymptote == floor the trend is flat at that level, which — with a non-zero noise — is a pure-noise curve.

Fields

§asymptote: f64

The value the trend approaches as the step grows.

§rate: f64

The saturation rate; larger climbs faster.

§floor: f64

The value at step zero (the trend’s floor).

§noise: f64

The amplitude of the deterministic wobble added to the trend.

§

Table

An explicit (step, value) table — the most knowable curve of all, for hand-verified oracle scenarios.

The points must be in ascending step order. A query lands on the value of the largest listed step that is <= step (a right-continuous step function); a query below the first listed step returns the first value; an empty table is NaN everywhere.

Fields

§points: Vec<(u64, f64)>

The (step, value) knots, ascending by step.

Implementations§

§

impl LearningCurve

pub const fn saturating(asymptote: f64, rate: f64) -> Self

A smooth monotone-saturating curve rising from 0 toward asymptote.

pub const fn noisy(asymptote: f64, rate: f64, noise: f64) -> Self

A saturating trend with a bounded deterministic wobble of amplitude noise (in the same units as the value).

pub const fn noisy_flat(level: f64, noise: f64) -> Self

A flat trend at level plus deterministic noise of amplitude noise.

A set of these with distinct per-trial seeds differs only by its noise — the fixture the variance-aware pruner must not prune.

pub const fn deceptive(plateau: f64) -> Self

The deceptive family: rises fast (high rate) to a low plateau.

Best early, mediocre late — the shape a myopic pruner is tempted to promote and a good one eventually catches once the late bloomers overtake it. A convenience wrapper over saturating.

pub const fn slow_starter(asymptote: f64) -> Self

The slow-starter family: rises slowly (low rate) to a high asymptote.

Worst early, best late — the trial a pruner must not cut so long as it is above the pruning bar at the rungs it passes.

pub fn table<I>(points: I) -> Self
where I: IntoIterator<Item = (u64, f64)>,

An explicit (step, value) table (see Table).

pub fn value_at(&self, step: u64, seed: u64) -> f64

The curve’s value at step, under the noise realization keyed by seed.

seed is consulted only by the noisy family; a smooth curve or a table ignores it, so its value depends on the step alone.

Trait Implementations§

§

impl Clone for LearningCurve

§

fn clone(&self) -> LearningCurve

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for LearningCurve

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl PartialEq for LearningCurve

§

fn eq(&self, other: &LearningCurve) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl StructuralPartialEq for LearningCurve

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more