Struct burn::train::TrainEpoch
pub struct TrainEpoch<TI> { /* private fields */ }
Expand description
A training epoch.
Implementations§
§impl<TI> TrainEpoch<TI>
impl<TI> TrainEpoch<TI>
pub fn new(
dataloader: Arc<dyn DataLoader<TI>>,
epoch: usize,
epoch_total: usize,
grad_accumulation: Option<usize>,
) -> TrainEpoch<TI>
pub fn new( dataloader: Arc<dyn DataLoader<TI>>, epoch: usize, epoch_total: usize, grad_accumulation: Option<usize>, ) -> TrainEpoch<TI>
Constructs a new TrainEpoch
.
§impl<TI> TrainEpoch<TI>
impl<TI> TrainEpoch<TI>
pub fn run<LC, TO>(
&self,
model: <LC as LearnerComponents>::Model,
optim: <LC as LearnerComponents>::Optimizer,
scheduler: &mut <LC as LearnerComponents>::LrScheduler,
processor: &mut <LC as LearnerComponents>::EventProcessor,
interrupter: &TrainingInterrupter,
) -> (<LC as LearnerComponents>::Model, <LC as LearnerComponents>::Optimizer)where
LC: LearnerComponents,
<LC as LearnerComponents>::EventProcessor: EventProcessor<ItemTrain = TO>,
<LC as LearnerComponents>::Model: TrainStep<TI, TO>,
pub fn run<LC, TO>(
&self,
model: <LC as LearnerComponents>::Model,
optim: <LC as LearnerComponents>::Optimizer,
scheduler: &mut <LC as LearnerComponents>::LrScheduler,
processor: &mut <LC as LearnerComponents>::EventProcessor,
interrupter: &TrainingInterrupter,
) -> (<LC as LearnerComponents>::Model, <LC as LearnerComponents>::Optimizer)where
LC: LearnerComponents,
<LC as LearnerComponents>::EventProcessor: EventProcessor<ItemTrain = TO>,
<LC as LearnerComponents>::Model: TrainStep<TI, TO>,
§impl<TI> TrainEpoch<TI>
impl<TI> TrainEpoch<TI>
pub fn run_multi_device<LC, TO>(
&self,
model: <LC as LearnerComponents>::Model,
optim: <LC as LearnerComponents>::Optimizer,
lr_scheduler: &mut <LC as LearnerComponents>::LrScheduler,
processor: &mut <LC as LearnerComponents>::EventProcessor,
devices: Vec<<<LC as LearnerComponents>::Backend as Backend>::Device>,
interrupter: &TrainingInterrupter,
) -> (<LC as LearnerComponents>::Model, <LC as LearnerComponents>::Optimizer)
pub fn run_multi_device<LC, TO>( &self, model: <LC as LearnerComponents>::Model, optim: <LC as LearnerComponents>::Optimizer, lr_scheduler: &mut <LC as LearnerComponents>::LrScheduler, processor: &mut <LC as LearnerComponents>::EventProcessor, devices: Vec<<<LC as LearnerComponents>::Backend as Backend>::Device>, interrupter: &TrainingInterrupter, ) -> (<LC as LearnerComponents>::Model, <LC as LearnerComponents>::Optimizer)
Auto Trait Implementations§
impl<TI> Freeze for TrainEpoch<TI>
impl<TI> !RefUnwindSafe for TrainEpoch<TI>
impl<TI> !Send for TrainEpoch<TI>
impl<TI> !Sync for TrainEpoch<TI>
impl<TI> Unpin for TrainEpoch<TI>
impl<TI> !UnwindSafe for TrainEpoch<TI>
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