Struct burn::train::ValidEpoch
pub struct ValidEpoch<VI> { /* private fields */ }
Expand description
A validation epoch.
Implementations§
§impl<VI> ValidEpoch<VI>
impl<VI> ValidEpoch<VI>
pub fn new(
dataloader: Arc<dyn DataLoader<VI>>,
epoch: usize,
epoch_total: usize,
) -> ValidEpoch<VI>
pub fn new( dataloader: Arc<dyn DataLoader<VI>>, epoch: usize, epoch_total: usize, ) -> ValidEpoch<VI>
Constructs a new ValidEpoch
.
§impl<VI> ValidEpoch<VI>
impl<VI> ValidEpoch<VI>
pub fn run<LC, VO>(
&self,
model: &<LC as LearnerComponents>::Model,
processor: &mut <LC as LearnerComponents>::EventProcessor,
interrupter: &TrainingInterrupter,
)where
LC: LearnerComponents,
<LC as LearnerComponents>::EventProcessor: EventProcessor<ItemValid = VO>,
<<LC as LearnerComponents>::Model as AutodiffModule<<LC as LearnerComponents>::Backend>>::InnerModule: ValidStep<VI, VO>,
pub fn run<LC, VO>(
&self,
model: &<LC as LearnerComponents>::Model,
processor: &mut <LC as LearnerComponents>::EventProcessor,
interrupter: &TrainingInterrupter,
)where
LC: LearnerComponents,
<LC as LearnerComponents>::EventProcessor: EventProcessor<ItemValid = VO>,
<<LC as LearnerComponents>::Model as AutodiffModule<<LC as LearnerComponents>::Backend>>::InnerModule: ValidStep<VI, VO>,
Runs the validation epoch.
§Arguments
model
- The model to validate.processor
- The event processor to use.
Auto Trait Implementations§
impl<VI> Freeze for ValidEpoch<VI>
impl<VI> !RefUnwindSafe for ValidEpoch<VI>
impl<VI> !Send for ValidEpoch<VI>
impl<VI> !Sync for ValidEpoch<VI>
impl<VI> Unpin for ValidEpoch<VI>
impl<VI> !UnwindSafe for ValidEpoch<VI>
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