pub struct SoftmaxCrossEntropyLoss;Expand description
Softmax over the logits with cross-entropy loss, the usual classifier head
(C++ SoftmaxCrossEntropyHeadLoss): delta = t - softmax(z).
The largest logit is subtracted before exp, so every argument is <= 0
and every exp lies in [0, 1]: no format overflows however large the
logits grow. See SoftmaxExp for the classes 6 or more behind.
Implementations§
Source§impl SoftmaxCrossEntropyLoss
impl SoftmaxCrossEntropyLoss
Sourcepub fn probabilities<V: SoftmaxExp, const N: usize>(logits: &[V; N]) -> [V; N]
pub fn probabilities<V: SoftmaxExp, const N: usize>(logits: &[V; N]) -> [V; N]
The softmax of logits. In the Q formats the probabilities are
rounded by the format, so they need not sum to exactly 1.
Trait Implementations§
Source§impl<V: SoftmaxExp> HeadLoss<V> for SoftmaxCrossEntropyLoss
impl<V: SoftmaxExp> HeadLoss<V> for SoftmaxCrossEntropyLoss
Auto Trait Implementations§
impl Freeze for SoftmaxCrossEntropyLoss
impl RefUnwindSafe for SoftmaxCrossEntropyLoss
impl Send for SoftmaxCrossEntropyLoss
impl Sync for SoftmaxCrossEntropyLoss
impl Unpin for SoftmaxCrossEntropyLoss
impl UnsafeUnpin for SoftmaxCrossEntropyLoss
impl UnwindSafe for SoftmaxCrossEntropyLoss
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