Week 2 - Assignment 4.3 Exercise 5


I got the below assertion error:

AssertionError: Wrong values for grads[‘dw’]. [[-0.00154399]
[-0.00492761]] != [[0.99845601]

I verified with the public_test.py and realised the value of Y is different. In the notebook, the value of Y is Y = np.array([[1, 0, 1]]). While in the public test.py the value of Y is np.array([[1, 1, 0]].

Hi, are you sure about that? In the assessment code for that exercise I have

w =  np.array([[1.], [2.]])
b = 2.
X =np.array([[1., 2., -1.], [3., 4., -3.2]])
Y = np.array([[1, 1, 0]])
grads, cost = propagate(w, b, X, Y)

assert type(grads["dw"]) == np.ndarray
assert grads["dw"].shape == (2, 1)
assert type(grads["db"]) == np.float64

print ("dw = " + str(grads["dw"]))
print ("db = " + str(grads["db"]))
print ("cost = " + str(cost))


Could it be that you don’t have the latest version of the notebook? You can get it by clicking on Help in the top right corner and then clicking the button Get latest version. Before doing that I would recommend you to save your current notebook as I guess it will remove your previous work. For example, you could save your current notebook using the “Save as” function so you have it as reference.

Thanks! this was solved after yesterday’s update

1 Like

I don’t see the “Get latest version” button on my notebook. How do I get the latest version since I am getting the same errors in the cost function?