title: Keras - Error when checking target: expected activation_5 to have shape (2,) but got array with shape (1,)
body: <p>In an LSTM network I'm passing as feature an array of the form </p>
  
  <pre><code>X
  array([[1],[2],...,[12]],
        [[2],[3],...,[13]],...
        [[999],[1000],...,[1011]]
        [[1000],[1001],...,[1012]])
  </code></pre>
  
  <p>So it's shape is (1000, 12, 1)</p>
  
  <p>And the target is an array with two possible values 0 and 1 of the form</p>
  
  <pre><code>y 
  array([[1], [0], [0], [1], ..., [0]])
  </code></pre>
  
  <p>So it's shape is (1000, 1)</p>
  
  <p>What I'm I doing wrong taking into account that I have to use a softmax activation and a Dense 2? </p>
  
  <p>Here's the construction of the network.</p>
  
  <pre><code>model = Sequential()
  model.add(LSTM(25, input_shape=(12, 1)))
  model.add(Dropout(0.1))
  model.add(Dense(2))
  model.add(Activation('softmax'))
  model.compile(loss="mse", optimizer="rmsprop")
  model.fit(X, y, epochs=1000, batch_size=80, verbose=1, shuffle=False, callbacks=[EarlyStopping(patience=10)])
  </code></pre>
  
  <p>My guess is that it has to do with the shape of the target but I'm not sure how to fix it.</p>
  
  <p>Thanks!</p>