W3A1 assignment (introduction to tensorFlow)

When creating a post, please add:

  • Week 3
  • W3A1 - Excercise 6

I calculated per sample loss using tf.keras.losses.categorical_crossentropy and did use tf.reduce_sum() to calculate the total loss but the test still not passed with error

Test 1 does not match. Did you get the reduce sum of your loss functions?

link to assigment TensorFlow Introduction | Coursera

not sure what wrong here?

I figure it out, the tf.keras.losses.categorical_crossentropy expect different dimension, transposing the input before feeding into the categorical_crossentropy would solve the problem.

Note that the new tf version(mine is 2.15.0) adds axis arg, by setting axis=0 also works.

Thanks for your update.

Note: You’re expected to complete the assignments using the Coursera Labs platform, so you don’t need to make any changes for different versions.