Problem grading Gradient_Checking

It seems the original code I wrote for Gradient_Checking lab worked, and the tests would fail with the correct error. All the “GRADED” functions are correct.
But when I made changes to the forward_propagation_n and backward_propagation_n functions as suggested, but which are ungraded, because the code subsequently failed with a different error, I am now getting a much reduced grade when I submit the assignment.
How can I either get the original code for functions forward_propagation_n and backward_propagation_n, or submit as it is and get the correct grade?
Before I made the changes, all was good.

But now the grading result I’m getting is as below, and I can’t get it to fail correctly regardless of what happens with the 2 ungraded modified functions.:
[ValidateApp | INFO] Validating ‘/home/jovyan/work/submitted/courseraLearner/W1A3/Gradient_Checking.ipynb’
[ValidateApp | INFO] Executing notebook with kernel: python3
Tests failed on 1 cell(s)! These tests could be hidden. Please check your submission.

The following cell failed:

X, Y, parameters = gradient_check_n_test_case()

cost, cache = forward_propagation_n(X, Y, parameters)
gradients = backward_propagation_n(X, Y, cache)
difference = gradient_check_n(parameters, gradients, X, Y, 1e-7, True)
expected_values = [0.2850931567761623, 1.1890913024229996e-07]
assert not(type(difference) == np.ndarray), "You are not using np.linalg.norm for n...
assert np.any(np.isclose(difference, expected_values)), "Wrong value. It is not one...

The error was:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-12-c57ee5e9e05a> in <module>
      6 expected_values = [0.2850931567761623, 1.1890913024229996e-07]
      7 assert not(type(difference) == np.ndarray), "You are not using np.linalg.no...
----> 8 assert np.any(np.isclose(difference, expected_values)), "Wrong value. It is...

AssertionError: Wrong value. It is not one of the expected values

Here is the guide to get a fresh copy of your assignment.

Also be sure that every time you modify any of the functions in a notebook, that you restart the kernel and run all of the cells again starting from the top of the notebook.

Thanks for that, I got a fresh copy, and after a few times restarting and re-running, all was good.

1 Like