pub struct StepStats {
pub loss: f32,
pub tokens: usize,
pub optimizer_step: bool,
pub grad_norm: Option<f32>,
pub lr: Option<f32>,
}Expand description
Result of one Trainer::train_step_masked call.
Fields§
§loss: f32Mean cross-entropy over the supervised tokens of this sequence.
tokens: usizeNumber of supervised (unmasked) target tokens.
optimizer_step: boolWhether this call completed an accumulation window and updated the
parameters (false while accumulating or after an fp16 overflow).
grad_norm: Option<f32>Global L2 norm of the gradients before clipping, when the optimizer stepped.
lr: Option<f32>Learning rate used for the optimizer step.
Trait Implementations§
impl Copy for StepStats
impl StructuralPartialEq for StepStats
Auto Trait Implementations§
impl Freeze for StepStats
impl RefUnwindSafe for StepStats
impl Send for StepStats
impl Sync for StepStats
impl Unpin for StepStats
impl UnsafeUnpin for StepStats
impl UnwindSafe for StepStats
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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