pub struct DynamicScheduler { /* private fields */ }Expand description
A dynamic scheduler that adjusts its behavior based on training metrics.
This scheduler can dynamically switch between different scheduling strategies based on training progress, loss trends, or other metrics.
Implementations§
Source§impl DynamicScheduler
impl DynamicScheduler
Sourcepub fn new(
primary_scheduler: Box<dyn LRScheduler>,
fallback_scheduler: Box<dyn LRScheduler>,
switch_condition: SwitchCondition,
window_size: usize,
) -> Self
pub fn new( primary_scheduler: Box<dyn LRScheduler>, fallback_scheduler: Box<dyn LRScheduler>, switch_condition: SwitchCondition, window_size: usize, ) -> Self
Creates a new dynamic scheduler.
Sourcepub fn update_metric(&mut self, metric: f32)
pub fn update_metric(&mut self, metric: f32)
Update with a new metric (e.g., loss value).
Sourcepub fn get_active_scheduler(&self) -> &str
pub fn get_active_scheduler(&self) -> &str
Get which scheduler is currently active.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DynamicScheduler
impl !RefUnwindSafe for DynamicScheduler
impl Send for DynamicScheduler
impl Sync for DynamicScheduler
impl Unpin for DynamicScheduler
impl !UnwindSafe for DynamicScheduler
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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 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>
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