W2_A2_Value Error_Dimensional Analysis

Hello,
I’m getting this error
File “”, line 46
dw = (1 / m) * np.dot (X, (A - Y).T)
^
SyntaxError: invalid syntax
Appreciate your help

Hi, I am also getting this error

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)
31 # YOUR CODE STARTS HERE
32
—> 33 A = 1 / (1 + np.exp(-X)) * (w.T * X + b)
34
35 cost = - 1 / m * np.sum((y * np.log(a)) + (1 - y) * np.log(1 - a))

ValueError: operands could not be broadcast together with shapes (1,2) (2,3)

  1. Syntax errors are often reported on the line after where the problem is.

  2. I recommend you use the sigmoid() function. It looks to me like your code for A = ... has incorrect parenthesis.

Hi @Manuel_Trujillo ,

For the syntax error, please check the previous line of code for parenthesis mismatch.