NLP course Sequence Models Week 3 final programming assignment doubt

Topic: Hard Negative Mining (Exercise 2)
Images removed by moderator as the post creator posted codes from grader cell and did not follow code of conduct

Loss value I am getting is 2.4 but the expected value is 0.7

Due to this My testcases are failing please help me fix it

Hi @Rashmi11

Refrain from posting any grade cell codes in future. It is against community guidelines and continuing to do so can affect your use of discourse community.

  1. Your scores code recall requires you to mention v2 before v1.
  2. your compute tf.maximum among 0.0 and A as well as for B is incorrect. Read the instructions carefully again. it first mentions you subtracts margin-positive and then that value to be added to mean_negative for A and in case of B margin-positive and then added to closest negative. Here using tuple plays a major significant role for getting the correct value of triplet_loss1 and triplet_loss2

Regards
DP

1 Like

I will make sure from next time. Thank You. It works.

1 Like