title: How to concatenate two layers in keras?
body: <p>I have an example of a neural network with two layers. The first layer takes two arguments and has one output. The second should take one argument as result of the first layer and one additional argument. It should looks like this:</p>
  
  <pre><code>x1  x2  x3
   \  /   /
    y1   /
     \  /
      y2
  </code></pre>
  
  <p>So, I'd created a model with two layers and tried to merge them but it returns an error: <code>The first layer in a Sequential model must get an "input_shape" or "batch_input_shape" argument.</code> on the line <code>result.add(merged)</code>.</p>
  
  <p>Model:</p>
  
  <pre class="lang-python prettyprint-override"><code>first = Sequential()
  first.add(Dense(1, input_shape=(2,), activation='sigmoid'))
  
  second = Sequential()
  second.add(Dense(1, input_shape=(1,), activation='sigmoid'))
  
  result = Sequential()
  merged = Concatenate([first, second])
  ada_grad = Adagrad(lr=0.1, epsilon=1e-08, decay=0.0)
  result.add(merged)
  result.compile(optimizer=ada_grad, loss=_loss_tensor, metrics=['accuracy'])
  </code></pre>