Please help me!!!
In my lab assignment of Week 2 - Exercise 5 - propagate, this error occurs:
Logistic_Regression_with_a_Neural_Network_mindset.ipynb (74.6 KB)
UnboundLocalError Traceback (most recent call last)
in
3 X = np.array([[1., -2., -1.], [3., 0.5, -3.2]])
4 Y = np.array([[1, 1, 0]])
----> 5 grads, cost = propagate(w, b, X, Y)
6
7 assert type(grads[“dw”]) == np.ndarray
in propagate(w, b, X, Y)
46
47 # YOUR CODE ENDS HERE
—> 48 cost = np.squeeze(np.array(cost))
49
50
UnboundLocalError: local variable ‘cost’ referenced before assignment.
I am not able to find bug. I am also attaching my jupyter lab notebook for better understanding.