C5 W4 Exercise 5 - Encoder "Wrong values case 3"

Hello Deepti,

Just uploaded again. Pls kindly advise.

Honestly Kenny,

You didn’t go through the comments one by one or you when I mentioned all the errors in the codes. You made only correct for tf.cast and dk and scaled attention_logits (this one is still not right)

I am sharing an updated notebook with corrections, kindly go through.

Regards
DP

Thanks Deepti, the problem is fixed. Hopefully there is no problem when submitting for grading.

I actually went through all comments one by one but there were not enough hints to fix in some parts.

Frankly, I think the units tests are quite bad in this exercise. There are problems in few exercises but the unit test still passes. For examples,

  • In positional_encoding exercise, the test passes although wrong argument was given to get_angles
  • In scaled_dot_product_attention, the test passes although k.T was put instead of using the tranpose_b param for tf.matmul for to caculate matmul_qk
  • In EncoderLayer, the test passes alhtough return_attention_scores=training was wrongly given as param to caculate self_mha_output.

As all these problems are not reflected in their own exercise but affecting the final Encoder output, It is quite difficult to track.