Compute cost failed to pass

HI,
In the last assigment of week3, I calculate the cost as below
cost = tf.reduce_mean(tf.keras.losses.categorical_crossentropy(y_pred=tf.transpose(logits), y_true=tf.transpose(labels)))

The result is 0.8071431, while the expected result is 0.4051435

What is wrong with my implementation ?

Hi @mc04xkf,

Maybe the problem is in the from_logits argument.

You can check about it here: https://www.tensorflow.org/api_docs/python/tf/keras/metrics/categorical_crossentropy

indeed it is due to from_logis, thanks.