Week 3 - compute_total_loss Incorrect

Hello DLAI team,

I am receiving the follow on exercise. 6…

I’ve read a couple of post where the logits and labels are transposed/reshaped… but no where is there any documentation on the API or how to execute… if this is this problem…
this is incredibly confusing

Would appreciate some guidance…

Thank you…

Output

tf.Tensor(17.175789, shape=(), dtype=float32)

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

2 Likes

There are four things to check:

  1. Make sure you did the transpose on the inputs.
  2. Make sure you use the from_logits option to tell the cost function that you are giving it logits and not activation values.
  3. Make sure you use reduce_sum and not reduce_mean to get the final scalar value.
  4. Make sure you specify the positional arguments to the loss function in the correct order.
19 Likes

Thanks Paul

I can confirm steps 2 and 3.

I was able to resolve…using tf.transpose

– Germán

2 Likes