Skip to main content

ScheduleProblem

Struct ScheduleProblem 

pub struct ScheduleProblem {
    pub segments: u32,
    pub x0: f64,
    pub shift: f64,
    pub peak: f64,
    pub penalty: f64,
    pub noise: f64,
    pub lr_low: f64,
    pub lr_high: f64,
}
Expand description

The nonstationary, schedule-dependent synthetic problem.

The reward for using learning rate lr in segment s is a downward parabola in x = log10(lr) centred on a segment-specific optimum x_opt(s) that decreases with s:

reward(s, lr) = peak − penalty · (x − x_opt(s))²   + small seeded noise
x_opt(s)      = x0 − shift · s                       (high early, low late)

The shift is deliberately matched to PBT’s perturbation granularity (one ×perturb_down step in log10), so a lineage that exploits-and-explores can track the moving optimum one segment at a time — the property that makes this a problem PBT solves rather than one no perturbation scale could follow. It is an honest feature of the fixture, not a thumb on the scale: the fixed baseline and random search face the identical reward.

Fields§

§segments: u32

How many segments (resource intervals) a full run trains through.

§x0: f64

x_opt(0), the optimum log10(lr) for the first segment (the highest).

§shift: f64

How far x_opt drops per segment (positive — the optimum moves down).

§peak: f64

The maximum per-segment reward (attained at lr == 10^x_opt(s)).

§penalty: f64

The curvature of the per-segment reward parabola in log10(lr).

§noise: f64

The amplitude of the seeded per-segment noise (RL curves are noisy, and it makes the reward a genuine function of the seed). Kept well below the margins the oracle asserts.

§lr_low: f64

The low end of the learning-rate search range.

§lr_high: f64

The high end of the learning-rate search range.

Implementations§

§

impl ScheduleProblem

pub fn x_opt(&self, segment: u32) -> f64

The optimal log10(lr) for segment s — high early, low late.

pub fn segment_reward(&self, segment: u32, lr: f64, seed: u64) -> f64

The reward earned by training segment segment with learning rate lr, under the noise realization keyed by seed.

A pure, total function: the downward parabola in log10(lr) plus a small bounded seeded wobble. Segments at or beyond segments earn nothing (the schedule is over), so a lineage’s accumulated reward plateaus at its full-schedule total.

pub fn fixed_total(&self, lr: f64, seed: u64) -> f64

The total reward a fixed learning rate accrues across the whole schedule, under a single reference seed.

pub fn best_fixed(&self, grid: u32, seed: u64) -> (f64, f64)

The best total any fixed learning rate reaches, swept over a dense grid of grid log-spaced values — the strong “best fixed hyperparameter” baseline PBT must beat.

Returns (lr, total).

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

The total an ideal schedule — sitting exactly on x_opt(s) at every segment — reaches: segments · peak before noise. The unreachable ceiling the fixed baseline falls short of and PBT climbs toward.

pub fn space(&self) -> Result<SpaceSchema>

The search space a study samples root learning rates from: a single log-uniform lr.

§Errors

Error::InvalidSpace if the range is degenerate (it never is for a well-formed problem).

Trait Implementations§

§

impl Clone for ScheduleProblem

§

fn clone(&self) -> ScheduleProblem

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 Copy for ScheduleProblem

§

impl Debug for ScheduleProblem

§

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

Formats the value using the given formatter. Read more
§

impl Default for ScheduleProblem

§

fn default() -> Self

The tuned default the oracle uses (see the module docs).

§

impl PartialEq for ScheduleProblem

§

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

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

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

Inequality operator !=. Read more
§

impl StructuralPartialEq for ScheduleProblem

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
§

impl<T> Boilerplate for T
where T: Copy + Send + Sync + Debug + PartialEq + 'static,

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