View source on GitHub |
Sparsemax loss function 1.
tfa.losses.sparsemax_loss(
logits: tfa.types.TensorLike
,
sparsemax: tfa.types.TensorLike
,
labels: tfa.types.TensorLike
,
name: Optional[str] = None
) -> tf.Tensor
Computes the generalized multi-label classification loss for the sparsemax function. The implementation is a reformulation of the original loss function such that it uses the sparsemax probability output instead of the internal \( au \) variable. However, the output is identical to the original loss function.
Returns | |
---|---|
A Tensor . Has the same type as logits .
|