I’m transposing both logics and labels to get the input format of [num examples, num classes], and setting the from_logics flag to True in the categorical_crossentropy function. I’m getting a mean of 20.218018, and the answer should be 0.4051435 I’m wondering if my input data is incorrect somehow. I’m not really sure what to look at next here to figure out what is going on. Any help is appreciated.
logits:
tf.Tensor(
[[ 2.4048107 -0.7921977 0.9447198 1.158121 4.768706 6.1481323 ]
[ 5.0334096 -4.1523376 -0.46802214 3.9810789 2.3220146 3.909829 ]], shape=(2, 6), dtype=float32)
labels:
tf.Tensor(
[[0. 0. 0. 0. 0. 1.]
[1. 0. 0. 0. 0. 0.]], shape=(2, 6), dtype=float32)
categorical_crossentropy:
tf.Tensor([23.754297 16.68174 ], shape=(2,), dtype=float32)
reduce_mean(categorical_crossentropy):
tf.Tensor(20.218018, shape=(), dtype=float32)