pub struct RegressionTrainer<B: AutodiffBackend> { /* private fields */ }Expand description
Trainer for regression models.
Implementations§
Source§impl<B: AutodiffBackend> RegressionTrainer<B>
impl<B: AutodiffBackend> RegressionTrainer<B>
Sourcepub fn new(config: RegressionTrainerConfig, device: B::Device) -> Self
pub fn new(config: RegressionTrainerConfig, device: B::Device) -> Self
Create a new trainer.
Sourcepub fn fit_with_forward<M, F, G>(
&self,
model: M,
dls: &TSDataLoaders,
forward_fn: F,
valid_forward_fn: G,
) -> Result<RegressionOutput<M>>where
M: AutodiffModule<B> + Clone,
F: Fn(&M, Tensor<B, 3>) -> Tensor<B, 2>,
G: Fn(&M::InnerModule, Tensor<B::InnerBackend, 3>) -> Tensor<B::InnerBackend, 2>,
pub fn fit_with_forward<M, F, G>(
&self,
model: M,
dls: &TSDataLoaders,
forward_fn: F,
valid_forward_fn: G,
) -> Result<RegressionOutput<M>>where
M: AutodiffModule<B> + Clone,
F: Fn(&M, Tensor<B, 3>) -> Tensor<B, 2>,
G: Fn(&M::InnerModule, Tensor<B::InnerBackend, 3>) -> Tensor<B::InnerBackend, 2>,
Train a regression model using a forward function.
This is a generic training method that takes a forward function closure to handle model-specific forward passes.
Auto Trait Implementations§
impl<B> Freeze for RegressionTrainer<B>
impl<B> RefUnwindSafe for RegressionTrainer<B>
impl<B> Send for RegressionTrainer<B>
impl<B> Sync for RegressionTrainer<B>
impl<B> Unpin for RegressionTrainer<B>
impl<B> UnsafeUnpin for RegressionTrainer<B>
impl<B> UnwindSafe for RegressionTrainer<B>
Blanket Implementations§
impl<T> Allocation for T
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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