W 3 A1 | Exercise 2 & Exercise 4

I have successfully completed the assignment but there are couple of points that are not clear to me.

#Exercise 2 – We have number of features 2 as X.shape = (2,400) but when we choose n_x why it is 5 instead of 2 and also why n_y is 2 instead of 1.

#Exercise 4 – While computing Z1 and Z2 , np.dot(W1.T,x) was giving error of shape
while (W1,x) was right, I didn’t get this point clearly as in the previous assignment we were able to calculate Z using transpose.


Hello, Shan.

To reply your query, please use this link to get a better idea of what and how it is taking place.

The layer_sizes function is applied to t_X and t_Y , **not to X and Y** .

Also, in exercise 4, W1 is already in transposed state. Although, in previous exercises, we had to transpose it first, but from week 3 onwards, the transpose is already done for you and you just have to apply it directly.