pub struct Learner<LC: LearnerComponents> { /* private fields */ }Expand description
Learner struct encapsulating all components necessary to train a Neural Network model.
To create a learner, use the builder struct.
Implementations§
Source§impl<LC: LearnerComponents> Learner<LC>
impl<LC: LearnerComponents> Learner<LC>
Sourcepub fn fit<InputTrain, InputValid, OutputTrain, OutputValid>(
self,
dataloader_train: Arc<dyn DataLoader<InputTrain>>,
dataloader_valid: Arc<dyn DataLoader<InputValid>>,
) -> LC::Modelwhere
InputTrain: Send + 'static,
InputValid: Send,
OutputTrain: Send + 'static,
OutputValid: Send,
LC::Model: TrainStep<InputTrain, OutputTrain>,
<LC::Model as AutodiffModule<LC::Backend>>::InnerModule: ValidStep<InputValid, OutputValid>,
LC::EventProcessor: EventProcessor<ItemTrain = OutputTrain, ItemValid = OutputValid>,
pub fn fit<InputTrain, InputValid, OutputTrain, OutputValid>(
self,
dataloader_train: Arc<dyn DataLoader<InputTrain>>,
dataloader_valid: Arc<dyn DataLoader<InputValid>>,
) -> LC::Modelwhere
InputTrain: Send + 'static,
InputValid: Send,
OutputTrain: Send + 'static,
OutputValid: Send,
LC::Model: TrainStep<InputTrain, OutputTrain>,
<LC::Model as AutodiffModule<LC::Backend>>::InnerModule: ValidStep<InputValid, OutputValid>,
LC::EventProcessor: EventProcessor<ItemTrain = OutputTrain, ItemValid = OutputValid>,
Auto Trait Implementations§
impl<LC> Freeze for Learner<LC>where
<LC as LearnerComponents>::Model: Freeze,
<LC as LearnerComponents>::Optimizer: Freeze,
<LC as LearnerComponents>::LrScheduler: Freeze,
<LC as LearnerComponents>::EventProcessor: Freeze,
<LC as LearnerComponents>::CheckpointerModel: Freeze,
<LC as LearnerComponents>::CheckpointerOptimizer: Freeze,
<LC as LearnerComponents>::CheckpointerLrScheduler: Freeze,
<LC as LearnerComponents>::CheckpointerStrategy: Freeze,
impl<LC> !RefUnwindSafe for Learner<LC>
impl<LC> !Send for Learner<LC>
impl<LC> !Sync for Learner<LC>
impl<LC> Unpin for Learner<LC>where
<LC as LearnerComponents>::Model: Unpin,
<LC as LearnerComponents>::Optimizer: Unpin,
<LC as LearnerComponents>::LrScheduler: Unpin,
<LC as LearnerComponents>::EventProcessor: Unpin,
<LC as LearnerComponents>::CheckpointerModel: Unpin,
<LC as LearnerComponents>::CheckpointerOptimizer: Unpin,
<LC as LearnerComponents>::CheckpointerLrScheduler: Unpin,
<LC as LearnerComponents>::CheckpointerStrategy: Unpin,
<<LC as LearnerComponents>::Backend as Backend>::Device: Unpin,
impl<LC> !UnwindSafe for Learner<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