HI, I’m currently working on Week2 Assignment. Need your help to move forward.
My cost function is:
A = sigmoid(np.dot(w.T,X)+b)
cost = np.dot(-1/m,((np.dot(Y,np.log(A)))+np.dot((1-Y),np.log(1-A))))
dw = 1/m * np.dot(X,(A-Y).T)
db = 1/m * (A-Y)
I get an error as below:
ValueError 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)
32
33 A = sigmoid(np.dot(w.T,X)+b)
—> 34 cost = np.dot(-1/m,((np.dot(Y,np.log(A)))+np.dot((1-Y),np.log(1-A))))
35
36 # YOUR CODE ENDS HERE
<array_function internals> in dot(*args, **kwargs)
ValueError: shapes (1,3) and (1,3) not aligned: 3 (dim 1) != 1 (dim 0)