title: Units in Dense layer in Keras
body: <p>I am trying to understand a concept of ANN architecture in Keras. Number of input neurons in any NN should be equal to the number of features/attributes/columns. So, in the case of having matrix of (20000,100), my input shape should have 100 neurons. In the example on the Keras page, I saw a code:    </p>
  
  <pre><code>model = Sequential([Dense(32, input_shape=(784,)),
  </code></pre>
  
  <p>, which pretty much means that input shape has 784 columns and 32 is the dimensionality of output space, which pretty means that the second layer will have an input of 32. My understanding is that such a significant drop happens because some of the units are not activated due to an activation function. Is my understanding correct?</p>
  
  <p>At the same time, another piece of code, shows that number of input neurons is higher than number of features:</p>
  
  <pre><code>model = Sequential()
  model.add(Dense(64, activation='relu', input_dim=20))
  model.add(Dropout(0.5))
  model.add(Dense(64, activation='relu'))
  model.add(Dropout(0.5))
  model.add(Dense(10, activation='softmax'))
  </code></pre>
  
  <p>This example is not clear to me. How can it be that the size of units is larger that number of input dimensions? </p>