Course 2 Week 1 Assignment 3 Exercise 4

I am unable to find the error in my code. I believe it to be in gradient_check_n

Here is the error I am getting

There is a mistake in the backward propagation! difference = 0.9999999330591424

AssertionError Traceback (most recent call last)
6 expected_values = [0.2850931567761623, 1.1890913024229996e-07]
7 assert not(type(difference) == np.ndarray), “You are not using np.linalg.norm for numerator or denominator”
----> 8 assert np.any(np.isclose(difference, expected_values)), “Wrong value. It is not one of the expected values”

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

Here are my values of Numerator, Denominator and Difference respectively


Any help or hints would be greatly appreciated!

Please send me your code in a private message. Click my name and message.

So, when copying your code from J_plus to J_minus , make sure to be extra careful.

1 Like