Warning: This project is deprecated. TensorFlow Addons has stopped development,
The project will only be providing minimal maintenance releases until May 2024. See the full
announcement here or on
github.
tfa.losses.sparsemax_loss
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.
Args |
logits
|
A Tensor . Must be one of the following types: float32 ,
float64 .
|
sparsemax
|
A Tensor . Must have the same type as logits .
|
labels
|
A Tensor . Must have the same type as logits .
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor . Has the same type as logits .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-05-25 UTC.
[null,null,["Last updated 2023-05-25 UTC."],[],[]]