Struct LearningCheckpointer
pub struct LearningCheckpointer<LC>where
LC: LearningComponentsTypes,{ /* private fields */ }Expand description
Used to create, delete, or load checkpoints of the training process.
Implementations§
§impl<LC> LearningCheckpointer<LC>where
LC: LearningComponentsTypes,
impl<LC> LearningCheckpointer<LC>where
LC: LearningComponentsTypes,
pub fn new(
model: AsyncCheckpointer<<<LC as LearningComponentsTypes>::TrainingModel as Module<<LC as LearningComponentsTypes>::Backend>>::Record, <LC as LearningComponentsTypes>::Backend>,
optim: AsyncCheckpointer<<<LC as LearningComponentsTypes>::Optimizer as Optimizer<<LC as LearningComponentsTypes>::TrainingModel, <LC as LearningComponentsTypes>::Backend>>::Record, <LC as LearningComponentsTypes>::Backend>,
lr_scheduler: AsyncCheckpointer<<<LC as LearningComponentsTypes>::LrScheduler as LrScheduler>::Record<<LC as LearningComponentsTypes>::Backend>, <LC as LearningComponentsTypes>::Backend>,
strategy: Box<dyn CheckpointingStrategy>,
) -> LearningCheckpointer<LC>
pub fn new( model: AsyncCheckpointer<<<LC as LearningComponentsTypes>::TrainingModel as Module<<LC as LearningComponentsTypes>::Backend>>::Record, <LC as LearningComponentsTypes>::Backend>, optim: AsyncCheckpointer<<<LC as LearningComponentsTypes>::Optimizer as Optimizer<<LC as LearningComponentsTypes>::TrainingModel, <LC as LearningComponentsTypes>::Backend>>::Record, <LC as LearningComponentsTypes>::Backend>, lr_scheduler: AsyncCheckpointer<<<LC as LearningComponentsTypes>::LrScheduler as LrScheduler>::Record<<LC as LearningComponentsTypes>::Backend>, <LC as LearningComponentsTypes>::Backend>, strategy: Box<dyn CheckpointingStrategy>, ) -> LearningCheckpointer<LC>
Constructs a new LearningCheckpointer.
§impl<LC> LearningCheckpointer<LC>where
LC: LearningComponentsTypes,
impl<LC> LearningCheckpointer<LC>where
LC: LearningComponentsTypes,
pub fn checkpoint(
&mut self,
learner: &Learner<LC>,
epoch: usize,
store: &EventStoreClient,
)
pub fn checkpoint( &mut self, learner: &Learner<LC>, epoch: usize, store: &EventStoreClient, )
Create checkpoint for the training process.
pub fn load_checkpoint(
&self,
learner: Learner<LC>,
device: &<<LC as LearningComponentsTypes>::Backend as Backend>::Device,
epoch: usize,
) -> Learner<LC>
pub fn load_checkpoint( &self, learner: Learner<LC>, device: &<<LC as LearningComponentsTypes>::Backend as Backend>::Device, epoch: usize, ) -> Learner<LC>
Load a training checkpoint.
Auto Trait Implementations§
impl<LC> Freeze for LearningCheckpointer<LC>
impl<LC> !RefUnwindSafe for LearningCheckpointer<LC>
impl<LC> Send for LearningCheckpointer<LC>
impl<LC> !Sync for LearningCheckpointer<LC>
impl<LC> Unpin for LearningCheckpointer<LC>
impl<LC> !UnwindSafe for LearningCheckpointer<LC>
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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