Struct ValidEpoch
pub struct ValidEpoch<B, VI>where
B: Backend,{ /* private fields */ }
Expand description
A validation epoch.
Implementations§
§
impl<B, VI> ValidEpoch<B, VI>where
B: Backend,
impl<B, VI> ValidEpoch<B, VI>where
B: Backend,
pub fn new(
dataloader: Arc<dyn DataLoader<B,
VI>>,
epoch: usize,
epoch_total: usize,
) -> ValidEpoch<B, VI>
pub fn new( dataloader: Arc<dyn DataLoader<B, VI>>, epoch: usize, epoch_total: usize, ) -> ValidEpoch<B, VI>
Constructs a new ValidEpoch
.
§
impl<B, VI> ValidEpoch<B, VI>where
B: Backend,
impl<B, VI> ValidEpoch<B, VI>where
B: Backend,
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>,
<LC as LearnerComponents>::Backend: AutodiffBackend<InnerBackend
= B>,
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>,
<LC as LearnerComponents>::Backend: AutodiffBackend<InnerBackend
= B>,
Runs the validation epoch.
§Arguments
model
- The model to validate.processor
- The event processor to use.
Auto Trait Implementations§
impl<B, VI> Freeze for ValidEpoch<B, VI>
impl<B, VI> !RefUnwindSafe for ValidEpoch<B, VI>
impl<B, VI> !Send for ValidEpoch<B, VI>
impl<B, VI> !Sync for ValidEpoch<B, VI>
impl<B, VI> Unpin for ValidEpoch<B, VI>
impl<B, VI> !UnwindSafe for ValidEpoch<B, 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
more
Source§
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