pub struct WeightedAccumulationState {
pub dtype: FloatDType,
pub loss_scale: f64,
pub total_weight: f64,
pub microbatches: u64,
}Expand description
Explicit normalization and continuation state of an accumulation window.
Fields§
§dtype: FloatDTypeF32/F64 arithmetic used before adding each microbatch’s gradients.
loss_scale: f64Loss multiplier actually applied by the caller throughout this window.
total_weight: f64Sum of caller-supplied effective token/sample weights, not batch count.
microbatches: u64Number of accepted microbatches, including explicit zero-weight batches.
Trait Implementations§
Source§impl Clone for WeightedAccumulationState
impl Clone for WeightedAccumulationState
Source§impl Debug for WeightedAccumulationState
impl Debug for WeightedAccumulationState
Source§impl<'de> Deserialize<'de> for WeightedAccumulationState
impl<'de> Deserialize<'de> for WeightedAccumulationState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<B: Backend> Record<B> for WeightedAccumulationState
impl<B: Backend> Record<B> for WeightedAccumulationState
Source§type Item<S: PrecisionSettings> = WeightedAccumulationState
type Item<S: PrecisionSettings> = WeightedAccumulationState
Type of the item that can be serialized and deserialized.
Source§fn into_item<S: PrecisionSettings>(self) -> Self
fn into_item<S: PrecisionSettings>(self) -> Self
Convert the current record into the corresponding item that follows the given settings.
Source§fn from_item<S: PrecisionSettings>(item: Self, _device: &B::Device) -> Self
fn from_item<S: PrecisionSettings>(item: Self, _device: &B::Device) -> Self
Convert the given item into a record.
impl StructuralPartialEq for WeightedAccumulationState
Auto Trait Implementations§
impl Freeze for WeightedAccumulationState
impl RefUnwindSafe for WeightedAccumulationState
impl Send for WeightedAccumulationState
impl Sync for WeightedAccumulationState
impl Unpin for WeightedAccumulationState
impl UnsafeUnpin for WeightedAccumulationState
impl UnwindSafe for WeightedAccumulationState
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