elegy/losses/sparse_categorical_crossentropy.py
def call(
        self, y_true, y_pred, sample_weight: tp.Optional[jnp.ndarray] = None
    ) -> jnp.ndarray:
        """
        Invokes the `SparseCategoricalCrossentropy` instance.

        Arguments:
            y_true: Ground truth values.
            y_pred: The predicted values.
            sample_weight: Acts as a
                coefficient for the loss. If a scalar is provided, then the loss is
                simply scaled by the given value. If `sample_weight` is a tensor of size
                `[batch_size]`, then the total loss for each sample of the batch is
                rescaled by the corresponding element in the `sample_weight` vector. If
                the shape of `sample_weight` is `[batch_size, d0, .. dN-1]` (or can be
                broadcasted to this shape), then each loss element of `y_pred` is scaled
                by the corresponding value of `sample_weight`. (Note on`dN-1`: all loss
                functions reduce by 1 dimension, usually axis=-1.)

        Returns:
            Loss values per sample.
        """

        return sparse_categorical_crossentropy(
            y_true, y_pred, from_logits=self._from_logits
        )

        Invokes the `SparseCategoricalCrossentropy` instance.

        Arguments:
            y_true: Ground truth values.
            y_pred: The predicted values.
            sample_weight: Acts as a
                coefficient for the loss. If a scalar is provided, then the loss is
                simply scaled by the given value. If `sample_weight` is a tensor of size
                `[batch_size]`, then the total loss for each sample of the batch is
                rescaled by the corresponding element in the `sample_weight` vector. If
                the shape of `sample_weight` is `[batch_size, d0, .. dN-1]` (or can be
                broadcasted to this shape), then each loss element of `y_pred` is scaled
                by the corresponding value of `sample_weight`. (Note on`dN-1`: all loss
                functions reduce by 1 dimension, usually axis=-1.)

        Returns:
            Loss values per sample.
        
Invokes the `SparseCategoricalCrossentropy` instance.
Invokes the ` SparseCategoricalCrossentropy ` instance .
def call(
        self, y_true, y_pred, sample_weight: tp.Optional[jnp.ndarray] = None
    ) -> jnp.ndarray:
        return sparse_categorical_crossentropy(
            y_true, y_pred, from_logits=self._from_logits
        )
def call ( self , y_true , y_pred , sample_weight : tp . Optional [ jnp . ndarray ] = None ) -> jnp . ndarray : return sparse_categorical_crossentropy ( y_true , y_pred , from_logits = self . _from_logits )
Invokes the `SparseCategoricalCrossentropy` instance.
Invokes the ` SparseCategoricalCrossentropy ` instance .
"""
        Invokes the `SparseCategoricalCrossentropy` instance.

        Arguments:
            y_true: Ground truth values.
            y_pred: The predicted values.
            sample_weight: Acts as a
                coefficient for the loss. If a scalar is provided, then the loss is
                simply scaled by the given value. If `sample_weight` is a tensor of size
                `[batch_size]`, then the total loss for each sample of the batch is
                rescaled by the corresponding element in the `sample_weight` vector. If
                the shape of `sample_weight` is `[batch_size, d0, .. dN-1]` (or can be
                broadcasted to this shape), then each loss element of `y_pred` is scaled
                by the corresponding value of `sample_weight`. (Note on`dN-1`: all loss
                functions reduce by 1 dimension, usually axis=-1.)

        Returns:
            Loss values per sample.
        """
Loss values per sample.
Loss values per sample .
self
y_true
Ground truth values.
Ground truth values .
y_pred
The predicted values.
The predicted values .
sample_weight
tp.Optional[jnp.ndarray]
Acts as a
coefficient for the loss. If a scalar is provided, then the loss is
simply scaled by the given value. If `sample_weight` is a tensor of size
`[batch_size]`, then the total loss for each sample of the batch is
rescaled by the corresponding element in the `sample_weight` vector. If
the shape of `sample_weight` is `[batch_size, d0, .. dN-1]` (or can be
broadcasted to this shape), then each loss element of `y_pred` is scaled
by the corresponding value of `sample_weight`. (Note on`dN-1`: all loss
functions reduce by 1 dimension, usually axis=-1.)
Acts as a coefficient for the loss . If a scalar is provided then the loss is simply scaled by the given value . If ` sample_weight ` is a tensor of size ` [ batch_size ] ` then the total loss for each sample of the batch is rescaled by the corresponding element in the ` sample_weight ` vector . If the shape of ` sample_weight ` is ` [ batch_size d0 .. dN - 1 ] ` ( or can be broadcasted to this shape ) then each loss element of ` y_pred ` is scaled by the corresponding value of ` sample_weight ` . ( Note on ` dN - 1 ` : all loss functions reduce by 1 dimension usually axis = - 1 . )