pub struct TrainingState {
pub epoch: usize,
pub global_step: usize,
pub best_metric: f32,
pub train_losses: Vec<f32>,
pub val_losses: Vec<f32>,
pub lr_history: Vec<f32>,
}Expand description
Current training state.
Fields§
§epoch: usizeCurrent epoch (0-indexed)
global_step: usizeGlobal step count
best_metric: f32Best validation metric
train_losses: Vec<f32>Training loss history
val_losses: Vec<f32>Validation loss history
lr_history: Vec<f32>Learning rate history
Implementations§
Source§impl TrainingState
impl TrainingState
Sourcepub fn current_epoch(&self) -> usize
pub fn current_epoch(&self) -> usize
Returns the current epoch (1-indexed for display).
Sourcepub fn avg_train_loss(&self) -> f32
pub fn avg_train_loss(&self) -> f32
Returns average training loss for current epoch.
Sourcepub fn last_val_loss(&self) -> Option<f32>
pub fn last_val_loss(&self) -> Option<f32>
Returns the last validation loss.
Trait Implementations§
Source§impl Clone for TrainingState
impl Clone for TrainingState
Source§fn clone(&self) -> TrainingState
fn clone(&self) -> TrainingState
Returns a duplicate of the value. Read more
1.0.0 · 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 TrainingState
impl Debug for TrainingState
Auto Trait Implementations§
impl Freeze for TrainingState
impl RefUnwindSafe for TrainingState
impl Send for TrainingState
impl Sync for TrainingState
impl Unpin for TrainingState
impl UnsafeUnpin for TrainingState
impl UnwindSafe for TrainingState
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