View source on GitHub
|
Computes the Generalized Cross Entropy loss.
tf.keras.losses.categorical_generalized_cross_entropy(
y_true, y_pred, q
)
Generalized Cross Entropy (GCE) is a noise-robust loss function that provides better robustness against noisy labels than standard cross entropy. It generalizes both cross entropy and mean absolute error through the parameter q, where values closer to 1 make the loss more robust to noisy labels.
Formula:
loss = (1 - p**q) / q
where p is the predicted probability for the true class and q
is the noise parameter.
Returns | |
|---|---|
GCE loss values with shape [batch_size].
|
<!-- Tabular view -->
<table class="responsive fixed orange">
<colgroup><col width="214px"><col></colgroup>
<tr><th colspan="2"><h2 class="add-link">References</h2></th></tr>
<tr class="alt">
<td colspan="2">
- [Zhang, Sabuncu, 2018](https://arxiv.org/abs/1805.07836)
("Generalized Cross Entropy Loss for Training
Deep Neural Networks with Noisy Labels")
</td>
</tr>
</table>
View source on GitHub