Keras confusion about number of layers : <p>I'm a bit confused about the number of layers that are used in Keras models. The documentation is rather opaque on the matter.</p>

<p>According to Jason Brownlee the first layer technically consists of two layers, the input layer, specified by <code>input_dim</code> and a hidden layer. See the first questions on <a href="http://machinelearningmastery.com/tutorial-first-neural-network-python-keras/" rel="noreferrer">his blog</a>.</p>

<p>In all of the Keras documentation the first layer is generally specified as
<code>model.add(Dense(number_of_neurons, input_dim=number_of_cols_in_input, activtion=some_activation_function))</code>.</p>

<p>The most basic model we could make would therefore be:</p>

<pre><code> model = Sequential()
 model.add(Dense(1, input_dim = 100, activation = None))
</code></pre>

<p>Does this model consist of a single layer, where 100 dimensional input is passed through a single input neuron, or does it consist of two layers, first a 100 dimensional input layer and second a 1 dimensional hidden layer?</p>

<p>Further, if I were to specify a model like this, how many layers does it have?</p>

<pre><code>model = Sequential()
model.add(Dense(32, input_dim = 100, activation = 'sigmoid'))
model.add(Dense(1)))
</code></pre>

<p>Is this a model with 1 input layer, 1 hidden layer, and 1 output layer or is this a model with 1 input layer and 1 output layer?</p>
