pub struct CallbackList { /* private fields */ }Expand description
List of callbacks to execute in order.
Implementations§
Source§impl CallbackList
impl CallbackList
Sourcepub fn on_train_begin(&mut self, state: &TrainingState) -> TrainResult<()>
pub fn on_train_begin(&mut self, state: &TrainingState) -> TrainResult<()>
Execute on_train_begin for all callbacks.
Sourcepub fn on_train_end(&mut self, state: &TrainingState) -> TrainResult<()>
pub fn on_train_end(&mut self, state: &TrainingState) -> TrainResult<()>
Execute on_train_end for all callbacks.
Sourcepub fn on_epoch_begin(
&mut self,
epoch: usize,
state: &TrainingState,
) -> TrainResult<()>
pub fn on_epoch_begin( &mut self, epoch: usize, state: &TrainingState, ) -> TrainResult<()>
Execute on_epoch_begin for all callbacks.
Sourcepub fn on_epoch_end(
&mut self,
epoch: usize,
state: &TrainingState,
) -> TrainResult<()>
pub fn on_epoch_end( &mut self, epoch: usize, state: &TrainingState, ) -> TrainResult<()>
Execute on_epoch_end for all callbacks.
Sourcepub fn on_batch_begin(
&mut self,
batch: usize,
state: &TrainingState,
) -> TrainResult<()>
pub fn on_batch_begin( &mut self, batch: usize, state: &TrainingState, ) -> TrainResult<()>
Execute on_batch_begin for all callbacks.
Sourcepub fn on_batch_end(
&mut self,
batch: usize,
state: &TrainingState,
) -> TrainResult<()>
pub fn on_batch_end( &mut self, batch: usize, state: &TrainingState, ) -> TrainResult<()>
Execute on_batch_end for all callbacks.
Sourcepub fn on_validation_end(&mut self, state: &TrainingState) -> TrainResult<()>
pub fn on_validation_end(&mut self, state: &TrainingState) -> TrainResult<()>
Execute on_validation_end for all callbacks.
Sourcepub fn should_stop(&self) -> bool
pub fn should_stop(&self) -> bool
Check if any callback requests early stopping.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CallbackList
impl !RefUnwindSafe for CallbackList
impl !Send for CallbackList
impl !Sync for CallbackList
impl Unpin for CallbackList
impl !UnwindSafe for CallbackList
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> 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