I have passed all tests in the notebook but grader shows UNQ C3 and C4 as incorrect . Need some help with this
The test cases are there to give some confidence of your code, only some aspects of your code are tested. In UnQ C3 and C4, where some of the functions you created are called, and there must be some problem in those functions, causing the grader not to give any marks.
Here is a couple of suggestions to check your code:
- hard coded value
- parameter passing to function in wrong order
The only place in C3 where I’m using a hardcoded value is as an input to the clip function while clipping gradients. I suppose may be causing the error. But I don’t really see an issue with that. I have tried with several maxValues and loss remains constant. And since C3 is being used in C4, both of them are incorrect. But without a detailed error message, I can’t really fix anything. Grader only tells me that it’s incorrect and no further information is given
Also if parameters were being passed in the wrong order, wouldn’t the function itself throw an error
The problem with hard coded value is that if your code has to deal with a different value, than, your function would not work. Also, these exercises are there to encourage good programming practice too.
In regard to passing parameter the wrong order that I mentioned as a point for checking your code, you are right that the function might fail, but that depends on the value of those parameters. If they are the same, then, it might not throw an error.
One way to debug is to use print statement. Checking the values returned are as expected.