Description Usage Arguments Details Value
Sparsemax loss function [1].
1 2 3 4 5 | loss_sparsemax(
from_logits = TRUE,
reduction = tf$keras$losses$Reduction$SUM_OVER_BATCH_SIZE,
name = "sparsemax_loss"
)
|
from_logits |
Whether y_pred is expected to be a logits tensor. Default is True, meaning y_pred is the logits. |
reduction |
(Optional) Type of tf$keras$losses$Reduction to apply to loss. Default value is SUM_OVER_BATCH_SIZE. |
name |
Optional name for the op. |
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 properbility output instead of the internal au variable. However, the output is identical to the original loss function. [1]: https://arxiv.org/abs/1602.02068
A 'Tensor'. Has the same type as 'logits'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.