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: u32How many segments (resource intervals) a full run trains through.
x0: f64x_opt(0), the optimum log10(lr) for the first segment (the highest).
shift: f64How far x_opt drops per segment (positive — the optimum moves down).
peak: f64The maximum per-segment reward (attained at lr == 10^x_opt(s)).
penalty: f64The curvature of the per-segment reward parabola in log10(lr).
noise: f64The 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: f64The low end of the learning-rate search range.
lr_high: f64The high end of the learning-rate search range.
Implementations§
§impl ScheduleProblem
impl ScheduleProblem
pub fn segment_reward(&self, segment: u32, lr: f64, seed: u64) -> f64
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
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)
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
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>
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
impl Clone for ScheduleProblem
§fn clone(&self) -> ScheduleProblem
fn clone(&self) -> ScheduleProblem
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 ScheduleProblem
§impl Debug for ScheduleProblem
impl Debug for ScheduleProblem
§impl Default for ScheduleProblem
impl Default for ScheduleProblem
§impl PartialEq for ScheduleProblem
impl PartialEq for ScheduleProblem
impl StructuralPartialEq for ScheduleProblem
Auto Trait Implementations§
impl Freeze for ScheduleProblem
impl RefUnwindSafe for ScheduleProblem
impl Send for ScheduleProblem
impl Sync for ScheduleProblem
impl Unpin for ScheduleProblem
impl UnsafeUnpin for ScheduleProblem
impl UnwindSafe for ScheduleProblem
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