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

i am very troubled with the same problem , tried out everything but simply couldnt get it right

{mentor edit: code removed}

can you please help

Please do not share your assignment code on the forum. That is not allowed by the Code of Conduct.

I have edited your message to remove your code.

@Sambhav0000

Sambhav you need always create new topic rather than posting older Post threads, you can always share the older Post threads related to your issue in your created post. Now comes to your issue, you need to share your error screenshot if encountered or if your output doesn’t match the expected output share screenshot of the that instead of posting grade function codes.

Kindly follow community guidelines, refer faq section about the same.

I am really sorry mb

I am really sorry for all the trouble, I was not sure how make a new topic, so I thought I’ll just reply and get some help.

The FAQ section has all the information regarding how to post, how to use discourse community, and community guidelines, here is a link

Kindly provide the information I asked here in previous comment. Also I notice in other thread you are asking code solutions, kindly refrain from such activity or your membership will be flagged by community coordinator as a violation of Code of Conduct.

I am closing this thread as you have created a new topic and have responded to your created topic.

Regards
DP