{mentor edit: removed an image that contained part of the function code}
i am stuck on this error of gradient_check for week and cant move forward,please explain
{mentor edit: removed an image that contained part of the function code}
i am stuck on this error of gradient_check for week and cant move forward,please explain
Hello pravenn20,
Look carefully at denominator definition. Hope it will help you.
Regards
Christophe
In the future, please do not share your code on the forum. Posting the error messages is fine, but do not include your code. That is not allowed by the Code of Conduct.
with all due respect actually i had used the function np.linalg.norm but still the error claims that the function isnt used (as shown in that image) ,are you sure there is no mistake on behalf of the system and in course 2 this is the only assignment that is left and i am unable to move to the next course in DLS
Hello, maybe this can help; from the instructions of the assignment it says call np.linalg.norm twice in the denominator, but the variables being called on are not the same!

Hello @praveen20, you see, even though the error message is about np.linalg.norm, if you look at the line generating it, it is actually checking whether difference, which is the variable returned by your function, is close enough to the answer. If it is not close enough, it will get you that error message. Therefore, the checker is not like very intelligent, and it does not really look at whether you have used the correct function or not.

Since it indicated that your function’s return value is not good enough, if I were you, I would really take @cpl67 Christophe’s advice to check the denominator. There are three parts in it: the variables, the np.linalg.norm, and the operator. You have got the second one, then what about the first and the third one?
After this and if it still prompts some error, then I would further go back and check the other lines for this exercise.
Good luck,
Raymond
Hello @praveen20, to reassure you that the system is fine, I just made a new submission, and it passed with full marks. What you need to do now is to figure out why the function is not returning the correct value.
![]()
i admit the mistake was mine ,in one the earlier lines of code i made a mistake ,but since the error message claimed that np.linalg.norm wasn’t used when it was written clearly had me confused for a very long time ,the error is gone now
Hello @praveen20,
It’s not a problem at all. We are here to offer suggestions. I took this course as well and made many mistakes myself. In fact, I still make mistakes all the time!
For the content of the error message, I will submit a suggestion to the course team in these two days.
Let’s move forward, and happy learning!
Cheers,
Raymond
The feedback from that assert assumes that you’re making only the most obvious of mistakes (i.e. not using np.linalg.norm). It is not the correct assumption for all possible errors. So perhaps the assert could be cleaned-up to be less misleading.