Likely problems with my ex 4 and 6 answers in the C2W2 assignment on Improving Deep Neural Networks

I’ve got what I suppose is a reasonable mark for the C2W2 assignment (about optimization) on Improving Deep Neural Networks (93/96). However, two exercises are failing some test cases and I’m wondering why that is - exercise 4 (11/12 mark) and exercise 6 (10/12). I have what I think is a more or less straightforward implementation of the equations for each case and, of course, this passes all of the tests in the Jupyter notebook and most of the tests on the grader. I’ve experimented with changing around the equations to try to improve the numerical precision; but while these alternatives all did similarly well for grades - none of them allow me to pass the test cases that are failing. Any suggestions? My thoughts are - maybe this is some issue with the grader (probably unlikely), requires using deepcopy or something or that I do need something to avoid precision issues but didn’t come up with the correct solution earlier.

I’ve attached a screenshot of the grader feedback (with the area specific to the feedback selected so my code is not visible). I hope that is okay,

William

It’s fine to show the grader output. The only thing we aren’t supposed to share publicly is the solution code.

Exercise 6 is the Adam code. The most common problem there is handling the \epsilon value there. Note that it is in the denominator, but not under the square root, right?

For Exercise 4, that is a lot more straightforward and I don’t have a theory for subtle mistakes there. Maybe we’ll need to look at your code. We can’t do that on a public thread (as mentioned above), but please check your DMs for a message from me about how to proceed.