pub struct LearnerComponents<LC: LearnerComponentTypes> {
pub optim: LC::Optimizer,
pub lr_scheduler: LC::LrScheduler,
pub num_epochs: usize,
pub grad_accumulation: Option<usize>,
pub checkpointer: Option<LearnerCheckpointer<LC>>,
pub interrupter: Interrupter,
pub early_stopping: Option<Box<dyn CloneEarlyStoppingStrategy>>,
pub event_processor: LC::EventProcessor,
pub event_store: Arc<EventStoreClient>,
}Expand description
Struct to minimise parameters passed to LearningMethod::learn These components are used during training
Fields§
§optim: LC::OptimizerThe Optimizer used for the training.
lr_scheduler: LC::LrSchedulerThe learning rate scheduler used for the training.
num_epochs: usizeThe number of epochs the training should last.
grad_accumulation: Option<usize>Enables gradients accumulation.
checkpointer: Option<LearnerCheckpointer<LC>>A LearnerCheckpointer used to save and load training checkpoints.
interrupter: InterrupterAn Interupter that allows aborting the training/evaluation process early.
early_stopping: Option<Box<dyn CloneEarlyStoppingStrategy>>§event_processor: LC::EventProcessorAn EventProcessor that processes events happening during training and validation.
event_store: Arc<EventStoreClient>A reference to an EventStoreClient.
Auto Trait Implementations§
impl<LC> Freeze for LearnerComponents<LC>where
<LC as LearnerComponentTypes>::Optimizer: Freeze,
<LC as LearnerComponentTypes>::LrScheduler: Freeze,
<LC as LearnerComponentTypes>::EventProcessor: Freeze,
<LC as LearnerComponentTypes>::CheckpointerModel: Freeze,
<LC as LearnerComponentTypes>::CheckpointerOptimizer: Freeze,
<LC as LearnerComponentTypes>::CheckpointerLrScheduler: Freeze,
<LC as LearnerComponentTypes>::CheckpointerStrategy: Freeze,
impl<LC> !RefUnwindSafe for LearnerComponents<LC>
impl<LC> Send for LearnerComponents<LC>
impl<LC> !Sync for LearnerComponents<LC>
impl<LC> Unpin for LearnerComponents<LC>where
<LC as LearnerComponentTypes>::Optimizer: Unpin,
<LC as LearnerComponentTypes>::LrScheduler: Unpin,
<LC as LearnerComponentTypes>::EventProcessor: Unpin,
<LC as LearnerComponentTypes>::CheckpointerModel: Unpin,
<LC as LearnerComponentTypes>::CheckpointerOptimizer: Unpin,
<LC as LearnerComponentTypes>::CheckpointerLrScheduler: Unpin,
<LC as LearnerComponentTypes>::CheckpointerStrategy: Unpin,
impl<LC> !UnwindSafe for LearnerComponents<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
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