title: How to get one output for several timestep in Keras LSTM?
body: <p>I want to classifying a timeframe of data. So for example every 5 input, there's one output. But my code refuse to accept my output.</p>
  
  <pre><code>model = Sequential()
  model.add(GRU(32, input_shape=(TimeStep.TIME_STEP + 1, 10), return_sequences=True, activation='relu'))
  model.add(GRU(64, activation='relu', return_sequences=True))
  model.add(Dense(2, activation='hard_sigmoid'))
  
  model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=[categorical_accuracy])
  history = model.fit(TimeStep.fodder, TimeStep.target, epochs=50)
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>ValueError: Error when checking target: expected dense_1 to have shape (5, 2) but got array with shape (31057, 2)
  </code></pre>
  
  <p>It does have 31057 data point that each data point consist of 5 sequential data.</p>