pub struct LearningState<T: Float + Debug + ScalarOperand + Send + Sync + 'static> { /* private fields */ }Expand description
Learning state tracking
Implementations§
Source§impl<T: Float + Debug + ScalarOperand + Send + Sync + 'static> LearningState<T>
impl<T: Float + Debug + ScalarOperand + Send + Sync + 'static> LearningState<T>
pub fn new(config: &TransformerBasedOptimizerConfig<T>) -> Result<Self>
pub fn update_with_loss(&mut self, loss: T) -> Result<()>
Sourcepub fn current_learning_rate(&self) -> T
pub fn current_learning_rate(&self) -> T
Learning rate the schedule is currently at.
Sourcepub fn learning_schedule(&self) -> &LearningSchedule<T>
pub fn learning_schedule(&self) -> &LearningSchedule<T>
The learning-rate schedule this state advances on every recorded loss.
pub fn get_statistics(&self) -> LearningStatistics<T>
pub fn get_average_loss(&self) -> T
pub fn get_best_loss(&self) -> T
pub fn get_convergence_rate(&self) -> T
pub fn reset(&mut self) -> Result<()>
pub fn validate(&self) -> Result<ValidationResult>
pub fn to_serializable(&self) -> Result<SerializableLearningState<T>>
pub fn from_serializable( &mut self, state: SerializableLearningState<T>, ) -> Result<()>
Trait Implementations§
Source§impl<T: Clone + Float + Debug + ScalarOperand + Send + Sync + 'static> Clone for LearningState<T>
impl<T: Clone + Float + Debug + ScalarOperand + Send + Sync + 'static> Clone for LearningState<T>
Auto Trait Implementations§
impl<T> Freeze for LearningState<T>where
VecDeque<T>: Freeze,
Option<MetaState<T>>: Freeze,
VecDeque<TaskAdaptationRecord<T>>: Freeze,
LearningSchedule<T>: Freeze,
LearningPerformanceMetrics<T>: Freeze,
impl<T> RefUnwindSafe for LearningState<T>where
VecDeque<T>: RefUnwindSafe,
Option<MetaState<T>>: RefUnwindSafe,
VecDeque<TaskAdaptationRecord<T>>: RefUnwindSafe,
LearningSchedule<T>: RefUnwindSafe,
LearningPerformanceMetrics<T>: RefUnwindSafe,
impl<T> Send for LearningState<T>where
VecDeque<T>: Send,
Option<MetaState<T>>: Send,
VecDeque<TaskAdaptationRecord<T>>: Send,
LearningSchedule<T>: Send,
LearningPerformanceMetrics<T>: Send,
impl<T> Sync for LearningState<T>where
VecDeque<T>: Sync,
Option<MetaState<T>>: Sync,
VecDeque<TaskAdaptationRecord<T>>: Sync,
LearningSchedule<T>: Sync,
LearningPerformanceMetrics<T>: Sync,
impl<T> Unpin for LearningState<T>where
VecDeque<T>: Unpin,
Option<MetaState<T>>: Unpin,
VecDeque<TaskAdaptationRecord<T>>: Unpin,
LearningSchedule<T>: Unpin,
LearningPerformanceMetrics<T>: Unpin,
impl<T> UnsafeUnpin for LearningState<T>where
VecDeque<T>: UnsafeUnpin,
Option<MetaState<T>>: UnsafeUnpin,
VecDeque<TaskAdaptationRecord<T>>: UnsafeUnpin,
LearningSchedule<T>: UnsafeUnpin,
LearningPerformanceMetrics<T>: UnsafeUnpin,
impl<T> UnwindSafe for LearningState<T>where
VecDeque<T>: UnwindSafe,
Option<MetaState<T>>: UnwindSafe,
VecDeque<TaskAdaptationRecord<T>>: UnwindSafe,
LearningSchedule<T>: UnwindSafe,
LearningPerformanceMetrics<T>: UnwindSafe,
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
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.