C2_W1_Assignment question

C2_W1_Assignment

Hello fellows, My problem with this assignment is with Exercise 2.

There is a mismatch with the w and a_in shape to np.dot them. There´s no way I can make it work and I am stuck.

My code is:

def my_dense(a_in, W, b):
“”"
Computes dense layer
Args:
a_in (ndarray (n, )) : Data, 1 example
W (ndarray (n,j)) : Weight matrix, n features per unit, j units
b (ndarray (j, )) : bias vector, j units
Returns
a_out (ndarray (j,)) : j units|
“”"
{mentor edit: code removed

The problem is with the line z = np.dot…

w is not getting any column from W and the dot product cannot be computed.

I really appreciate your help on this…

First, please don’t post your code on the forum. That’s not allowed by the Code of Conduct.
If a mentor needs to see your code, we’ll contact you with instructions.
I’ll edit your message to remove the code.

Second, it’s better to post a screen capture image, rather than use a text copy-and-paste. The screen capture image will show your indentation.

Since I don’t see any indentation in your code, I don’t know if that’s the problem, or just an artifact of your copy-and-paste.

Wow! Sorry for that.

Don’t worry, it won’t happen again.