Keras.input shape

Hi, I am confused with kerns.input shape, as in my opinion, it should be X size which is 1000*400, but why wk1 assignment input shape is 400? Is it the size of w? How can I decide the input shape?

Is the input each row of X? I mean the data
so that for the first data, its shape is 400,1

so, the shape is the shape of each data but not the whole X, NN calculates based on each data
Am I right?

sorry it should be 1,400 for each data, so for the first data, we input each element within the 20*20 matrix, after the first data, NN gets the second data as the input

Hello @ricardowu1112

Since we are using a fully connected network, each input image which is of size 20x20 is flattened as a vector of size 400. So, each input image comprises of 400 features - This is what is specificed as shape = (400,))

1 Like

In designing the layer, you know the number of input features, but you don’t know the number of examples.

1 Like