pub struct CrossEntropyLoss<T: FloatBounds + ScalarOperand> { /* private fields */ }Expand description
Cross-entropy loss function
Implementations§
Source§impl<T: FloatBounds + ScalarOperand> CrossEntropyLoss<T>
impl<T: FloatBounds + ScalarOperand> CrossEntropyLoss<T>
Trait Implementations§
Source§impl<T: Clone + FloatBounds + ScalarOperand> Clone for CrossEntropyLoss<T>
impl<T: Clone + FloatBounds + ScalarOperand> Clone for CrossEntropyLoss<T>
Source§fn clone(&self) -> CrossEntropyLoss<T>
fn clone(&self) -> CrossEntropyLoss<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + FloatBounds + ScalarOperand> Debug for CrossEntropyLoss<T>
impl<T: Debug + FloatBounds + ScalarOperand> Debug for CrossEntropyLoss<T>
Source§impl<T: FloatBounds + ScalarOperand> LossFunction<T> for CrossEntropyLoss<T>
impl<T: FloatBounds + ScalarOperand> LossFunction<T> for CrossEntropyLoss<T>
Source§fn compute_loss(
&self,
predictions: &Array2<T>,
targets: &Array2<T>,
) -> Result<T, SklearsError>
fn compute_loss( &self, predictions: &Array2<T>, targets: &Array2<T>, ) -> Result<T, SklearsError>
Compute loss given predictions and targets
Source§fn compute_gradient(
&self,
predictions: &Array2<T>,
targets: &Array2<T>,
) -> Result<Array2<T>, SklearsError>
fn compute_gradient( &self, predictions: &Array2<T>, targets: &Array2<T>, ) -> Result<Array2<T>, SklearsError>
Compute loss gradient with respect to predictions
Auto Trait Implementations§
impl<T> Freeze for CrossEntropyLoss<T>
impl<T> RefUnwindSafe for CrossEntropyLoss<T>where
T: RefUnwindSafe,
impl<T> Send for CrossEntropyLoss<T>
impl<T> Sync for CrossEntropyLoss<T>
impl<T> Unpin for CrossEntropyLoss<T>where
T: Unpin,
impl<T> UnwindSafe for CrossEntropyLoss<T>where
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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