Computing total loss in assignment

Hi

I am pretty new to TensorFlow, and I would like to know how I can correctly implement the total loss by TensorFlow with the help of cross-entropy and reduce_sum.

I used the guidance in the notebook, and the result of my code was slightly different from the expected value.

I mean, my output is tf.Tensor(0.88275003, shape=(), dtype=float32) while the expected value is
tf.Tensor(0.810287, shape=(), dtype=float32). And running the test section, I receive this output “Test does not match. Did you get the reduce sum of your loss functions?”

Could you please help me to debug my code and realize my mistake?

Many thanks

Hello @Fatemeh-Esmaeili,

This thread may be helpful to your situation.

Cheers,
Raymond