title: batch_input_shape for Keras LSTM model
body: <p>I am trying to build a neural network with an LSTM as first hidden layer with the Keras library (tensorflow backend). I am having problem understanding how to reshape my data and feed it to a stateful LSTM with the batch_input_size parameter.</p>
  
  <p>My input is a 100 second time series sampled at 10 Khz. So basically, I have 100*10000 different values of time. I have 3 different observables being sampled, so the number of features is 3. Let us call X the input matrix, with shape:</p>
  
  <pre><code>np.shape(X) = (1000000,1,3)
  </code></pre>
  
  <p>My target has one value per each point in time --> 100*10000 values:</p>
  
  <pre><code>np.shape(Y) = (1000000,1,1)
  </code></pre>
  
  <p>I want my model to take one second at a time, and therefore predict 10000 target values. I suppose this should be the <strong>batch_size</strong>. target values Say I want to put 32 nodes in the LSTM layer, this is what I wrote:</p>
  
  <pre><code>model_LSTM = Sequential()
  model_LSTM.add(LSTM(32, stateful=True, batch_input_shape=(10000,1,3)))
  model_LSTM.compile(optimizer=keras.optimizers.Adam(lr=0.00039, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.0, amsgrad=False), loss='mean_squared_error')
  </code></pre>
  
  <p>To fit the model I  feed it one batch at a time:</p>
  
  <pre><code>batch_size=10000
  for i in range(int(X.shape[0] / batch_size)):
      X = X_l[(i * batch_size):((i + 1) * batch_size)][:][:]
      Y = Y_l[(i * batch_size):((i + 1) * batch_size)]
      model_hist = model_LSTM.fit(X, Y, epochs=1, 
                                  batch_size=batch_size, 
                                  verbose=1, shuffle=False)
  </code></pre>
  
  <p>Am I doing this correctly? The script runs without errors, but when using model_LSTM.predict() on a new set it just outputs the same value for each time step.</p>