Not sure what I’m doing wrong here, per the instructions I am computing Z
by multiplying arrays w
, X
and adding vector b
.
I’d suggest putting in some lines that would help you diagnose what the shapes of all the arrays in question are. I’m not entirelyvsure what the conpiler thinks is the 1x2 array and the 2x5 array is, but clearly the compiler thinks that b cannot be appropriately broadcast to (W * x)
So just for anyone else who is having similar issues, the instructions leave out that you can’t simply use *
for the matrix multiplication rather you need to use numpy.dot()
. In this case it will look like Z = W.dot(X) + b
. Clearly, as you can see from my screenshot, that is what I was doing that caused this error.
np.dot(w,x) + B.
it will work. I had passed problem like that when I used the dot product and it worked