pub struct Learner<LC>where
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§
§impl<LC> Learner<LC>where
LC: LearnerComponents,
impl<LC> Learner<LC>where
LC: LearnerComponents,
pub fn fit<InputTrain, InputValid, OutputTrain, OutputValid>(
self,
dataloader_train: Arc<dyn DataLoader<InputTrain>>,
dataloader_valid: Arc<dyn DataLoader<InputValid>>,
) -> <LC as LearnerComponents>::Modelwhere
InputTrain: Send + 'static,
InputValid: Send,
OutputTrain: Send + 'static,
OutputValid: Send,
<LC as LearnerComponents>::Model: TrainStep<InputTrain, OutputTrain>,
<<LC as LearnerComponents>::Model as AutodiffModule<<LC as LearnerComponents>::Backend>>::InnerModule: ValidStep<InputValid, OutputValid>,
<LC as LearnerComponents>::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 as LearnerComponents>::Modelwhere
InputTrain: Send + 'static,
InputValid: Send,
OutputTrain: Send + 'static,
OutputValid: Send,
<LC as LearnerComponents>::Model: TrainStep<InputTrain, OutputTrain>,
<<LC as LearnerComponents>::Model as AutodiffModule<<LC as LearnerComponents>::Backend>>::InnerModule: ValidStep<InputValid, OutputValid>,
<LC as LearnerComponents>::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
§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