W3_A1_Grader output 88%

/notebooks/release/W3A1/Planar_data_classification_with_one_hidden_layer.ipynb

2 Likes

What does the detailed grader feedback say?
Please post a screen capture image.

1 Like

Oh, sorry, sometimes the grader is mysterious and can’t tell us which function is failing. We’ll probably need to look at your code. I’ll send you a DM about how to proceed with that. You can recognize DMs from normal replies because they have a little “envelope” icon.

Just to close the loop on the public thread, the bug turned out to be in nn_model: the value of n_h was being hard-coded to 4. That works with the test in the notebook but the grader uses a different value. So it’s a case of the code not being “general”: it worked with one specific test case, but not in the general case.

Of course I can’t explain why the grader can’t be more specific about this error, but apparently that’s hard to fix in this case. So in cases like that, we have to do things the old fashioned way and look at the notebook.

Having the same problem ending up with an 88% grade even though all my tests have been successfully completed. Thanks.

The grader uses different tests. Passing the tests in the notebook does not prove your code is perfect.

Please post a screen capture image that shows the detailed feedback from the grader.

Just passing the tests in the notebook does not guarantee that your code is completely correct. There are lots of ways to write your code that makes it specific to the test cases in the notebook and then it fails a different test case. They have fixed the test cases so that the bug I mentioned earlier on this thread (hard-coding n_h to 4 in nn_model) no longer passes the local test cases, but there must be other ways to write non-general solutions.

1 Like

If those general hints aren’t enough to help, then please check your DMs for a message from me about how to proceed.

To close the loop on the public thread, the issue was that in the compute_cost code, the logic was written to use the dot product to compute the base loss value, so then no sum is needed. The logic later took the sum of that logprobs value using axis = 1 and that passes the tests in the notebook, but failed the grader. It looks like the grader has a test case in which the A value is a 1D array.

2 Likes