pub struct LossScalerConfig {
pub policy: ScaleUpdatePolicy,
pub initial_scale: f64,
pub min_scale: f64,
pub max_scale: f64,
pub scale_up_factor: f64,
pub scale_down_factor: f64,
pub scale_up_interval: u64,
}Expand description
Configuration parameters for a LossScaler.
Fields§
§policy: ScaleUpdatePolicyWhich update policy to use.
initial_scale: f64Starting loss scale (default 65536.0 = 2^16).
min_scale: f64Floor for the loss scale (default 1.0).
max_scale: f64Ceiling for the loss scale (default 2^24 = 16_777_216.0).
scale_up_factor: f64Multiplicative factor applied to the scale on a successful streak (Dynamic policy uses 2.0 to double; Gradual uses a configurable value close to 1, e.g. 1.001).
scale_down_factor: f64Multiplicative factor applied on overflow (should be < 1, e.g. 0.5).
scale_up_interval: u64Number of clean (non-overflow) steps required before a scale-up. For Dynamic this is often 2000; for Gradual it can be smaller.
Trait Implementations§
Source§impl Clone for LossScalerConfig
impl Clone for LossScalerConfig
Source§fn clone(&self) -> LossScalerConfig
fn clone(&self) -> LossScalerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LossScalerConfig
impl Debug for LossScalerConfig
Auto Trait Implementations§
impl Freeze for LossScalerConfig
impl RefUnwindSafe for LossScalerConfig
impl Send for LossScalerConfig
impl Sync for LossScalerConfig
impl Unpin for LossScalerConfig
impl UnsafeUnpin for LossScalerConfig
impl UnwindSafe for LossScalerConfig
Blanket Implementations§
impl<T> Allocation 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
Mutably borrows from an owned value. Read more
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,
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