How to extract bias weights in Keras sequential model? : <p>I'm running a simple feed-forward network using <em>Keras</em> . 
Having just one hidden layer I would like to make some inference regarding the relevance of each input to each output and I would like to extract the weights. </p>

<p>This is the model: </p>

<pre><code>def build_model(input_dim, output_dim):
    n_output_layer_1 = 150
    n_output = output_dim
    model = Sequential()
    model.add(Dense(n_output_layer_1, input_dim=input_dim, activation='relu'))
    model.add(Dropout(0.25))
    model.add(Dense(n_output))
</code></pre>

<p>To extract the weight I wrote: </p>

<pre><code>for layer in model.layers:
    weights = layer.get_weights() 


weights = np.array(weights[0])     #this is hidden to output
first = model.layers[0].get_weights() #input to hidden
first = np.array(first[0])
</code></pre>

<p>Unfortunately I don't get the biases columns in the matrices, which I know Keras automatically puts in it. </p>

<p><strong>Do you know how to retrieve the biases weights?</strong></p>

<p>Thank you in advance for your help !</p>
