In the “Logistic_Regression_with_a_Neural_Network_mindset”
Exercise 5 - propagate:
The test has :
w = np.array([[1.], [2]])
b = 1.5
X = np.array([[1., -2., -1.], [3., 0.5, -3.2]])
this seems wron as
w – weights, a numpy array of size (num_px * num_px * 3, 1)
b – bias, a scalar
X – data of size (num_px * num_px * 3, number of examples)
num_px * num_px * 3 can not be 2 for W
First, I spent 10 minutes finding out where this assignment is which you claim belongs to C1_W2 of the MLS Course 1. Thank you. It is in DLS Course 1. Please change it to respect everyone’s time.
Related to your query, why do you think it is wrong? Given that height = num_px and width = num_px.
Here is what I dont understand:
X = np.array([[1., -2., -1.], [3., 0.5, -3.2]])
does X have 2 images of 1 pixel each with an RGB each ?
w = np.array([[1.], [2]])
If so then does W not not need to have atleast 3 weights 1 for R, 1 for G, and 1 for B ?
No. We don’t choose separate values of weights for R, G, and B. Number of wights is depend on the number of neurons in the current and previous layers.
Right! The point is that we are writing general code here: it does not assume that the data is always an image. In the test case, it is a matrix X that happens to be 2 x 3. So the code needs to handle the actual dimensions of the inputs.