Replies: 1 comment 6 replies
-
Yes, the result is a an array matching the |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have a question about your code.
#losses.py
class ArcfaceLoss(tf.keras.losses.Loss):
[skip]
return tf.keras.losses.categorical_crossentropy(y_true, arcface_logits, from_logits=self.from_logits, label_smoothing=self.label_smoothing)
tf.keras.losses.categorical_crossentropy(y_true, arcface_logits, from_logits=self.from_logits, label_smoothing=self.label_smoothing)
===========> Multi-dimensional loss array.
Where is the reduction of the category_crossentropy result value?
I don't know where the sum, mean... part of the loss result is.
[sample]
y_true = [[0, 1, 0], [0, 0, 1]]
y_pred = [[0.0,32, 0], [0.0, 0.0, 16]]
loss = tf.keras.losses.categorical_crossentropy(y_true, y_pred,from_logits=True)
[result]
<tf.Tensor: shape=(2,), dtype=float32, numpy=array([0.0000000e+00, 2.3841855e-07], dtype=float32)>
https://www.tensorflow.org/api_docs/python/tf/keras/losses/CategoricalCrossentropy
thanks....
Beta Was this translation helpful? Give feedback.
All reactions