pub struct OneCycleScheduler { /* private fields */ }Expand description
Smith one-cycle ramp and cosine decay policy.
Implementations§
Source§impl OneCycleScheduler
impl OneCycleScheduler
Sourcepub fn new_with_defaults(
max_learning_rate: f32,
total_steps: u64,
) -> Result<Self>
pub fn new_with_defaults( max_learning_rate: f32, total_steps: u64, ) -> Result<Self>
Construct a one-cycle schedule with OA’s 0.3/25/10,000 defaults.
§Errors
Returns an error for an invalid maximum rate or empty span.
Sourcepub fn new(
max_learning_rate: f32,
total_steps: u64,
percent_start: f32,
division_factor: f32,
final_division_factor: f32,
) -> Result<Self>
pub fn new( max_learning_rate: f32, total_steps: u64, percent_start: f32, division_factor: f32, final_division_factor: f32, ) -> Result<Self>
Construct the donor-compatible one-cycle schedule.
§Errors
Returns an error for an invalid rate, empty span, percentage outside
[0, 1], or non-positive division factor.
Trait Implementations§
Source§impl LrScheduler for OneCycleScheduler
impl LrScheduler for OneCycleScheduler
Source§fn learning_rate(&self, step: u64) -> f32
fn learning_rate(&self, step: u64) -> f32
Return the learning rate for
step.Auto Trait Implementations§
impl Forget for OneCycleScheduler
impl Freeze for OneCycleScheduler
impl Move for OneCycleScheduler
impl RefUnwindSafe for OneCycleScheduler
impl Send for OneCycleScheduler
impl Sync for OneCycleScheduler
impl Unpin for OneCycleScheduler
impl UnsafeUnpin for OneCycleScheduler
impl UnwindSafe for OneCycleScheduler
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