W[1] in Week 3 Quiz

D​ue to Wk3 quiz, I don’t quite understand the shape of W[1]. In case, there are 4 units activation function aka a[1]. First of all, I have to calculate Z[1] = W[1]X + b[1]. I answered correctly about W[2], b[1] and b[2] but for W[1].shape I didn’t answer.

I​n my opinion, as there are 4 units in a[1] so there are w1, w2, w3, w4 in W[1]. Thus, its shape should be (4,1) regardless of number of examples or the number of features in X. (or (4, nx) but I am not informed about the number of features of an example). But the choices that I can select only have shape (2,4) and (4,2) for W[1].

I​s my understanding correct? or I misunderstood. Thanks

Your understanding is wrong. The formula for the “linear” activation for layer one is this:

Z^{[1]} = W^{[1]} \cdot X + b^{[1]}

In order for the dot product between W^{[1]} and X to work, the number of columns of W^{[1]} must equal the number of rows of X, right? The number of rows of X is the number of input features in each input sample. So the conclusion is that the number of features does matter for the shape of W^{[1]}.