pub struct PerplexityEvaluator;Implementations§
Source§impl PerplexityEvaluator
impl PerplexityEvaluator
Sourcepub fn evaluate(
model: &TernaryMLP,
test_samples: &[(Vec<f32>, Vec<f32>)],
) -> PerplexityReport
pub fn evaluate( model: &TernaryMLP, test_samples: &[(Vec<f32>, Vec<f32>)], ) -> PerplexityReport
Evaluate model on test_samples.
Each sample is (input: Vec<f32>, target: Vec<f32>).
The correct class for cross-entropy is argmax(target).
Auto Trait Implementations§
impl Freeze for PerplexityEvaluator
impl RefUnwindSafe for PerplexityEvaluator
impl Send for PerplexityEvaluator
impl Sync for PerplexityEvaluator
impl Unpin for PerplexityEvaluator
impl UnsafeUnpin for PerplexityEvaluator
impl UnwindSafe for PerplexityEvaluator
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
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