title: How can i reshape my data for keras lstm input?
body: <p>I'm new to Keras, and I find it hard to understand the shape of input data of the LSTM layer.<br>
  The Keras Document says that the input data should be 3D tensor with shape (nb_samples, timesteps, input_dim).</p>
  
  <p>I have 808 signals.<br>
  And each signal has 22 channel and 2000 data points.   </p>
  
  <pre><code>Data_shape : (808,22,2000)
  </code></pre>
  
  <p>Also i have 808 labels for each signal.</p>
  
  <pre><code>Label_shape : (808,2)
  Label[1,:] = [1,0]
  </code></pre>
  
  <p>I want to analyze with slice 2000 data points into 20 time steps, and each time steps(lstm cell) receive 100 data points.<br>
  In my thought, there are 20 LSTM cells and each LSTM cell receive (22,100) data which is 100 data points with 22 channel(features).</p>
  
  <p>so here is my questions  </p>
  
  <ol>
  <li><p>What is the right input shape for Keras LSTM in my data case?<br>
  And what should i change value on my LSTM model?<br>
  I had tried in this way now. I'm not sure with input shape.  </p>
  
  <pre><code>print(X_train.shape)  
  print(y_train.shape)
  (727, 22, 2000)
  (727, 2)
  
  model = Sequential()
  model.add(LSTM(20, input_shape=(22,2000), dropout=0.2, recurrent_dropout=0.2, return_sequences=True))
  model.add(Dense(20))
  model.add(LSTM(20, dropout=0.2, recurrent_dropout=0.2))
  model.add(Dense(2, activation='softmax'))
  model.compile(loss='binary_crossentropy', optimizer='Adadelta', metrics=['accuracy'])
  </code></pre></li>
  <li><p>What should i do with my data shape?<br>
  Should i reshape my data to another shape?</p></li>
  </ol>