title: Sequence Prediction using keras LSTM
body: <p>I want to use LSTM for sequence prediction.
  I am using keras for that.</p>
  
  <p>Instead of predicting next word in a sentence, I want to predict label of a line.
  In dataset, I have set of features and label associated with that line and bunch of documents which has set of lines.</p>
  
  <p>Ex.
  Documents : 200
  Lines in each document(VAriable but max number of lines I do zero padding at the end to match the length): 400
  Features associated with each line : 100</p>
  
  <p>So my input feature size is : 200 * 400 * 100</p>
  
  <p>Now each line has label associated with it which i want to predict. 
  Possible values of label = 3</p>
  
  <p>So my label size : 200*400*3</p>
  
  <p>I am using following code for modeling the LSTM.</p>
  
  <pre><code>model = Sequential()
  model.add(LSTM(50, input_shape=(400, 100)))
  model.add(Dense(3))
  model.add(Activation('softmax'))
  optimizer = RMSprop(lr=0.01)
  model.compile(loss='categorical_crossentropy', optimizer=optimizer)
  </code></pre>
  
  <p>I am getting some dimensional error which says:</p>
  
  <p>Error when checking model target: expected activation_3 to have 2 dimensions, but got array with shape (200L, 400L, 3L)</p>