title: How can I feed the previous predicted output yhat(t-1) together with x(t) for computing yhat(t) in keras
body: <p>Currently I am using the standard LSTM layer in keras to map a sequence to a sequence. See below. </p>
  
  <pre><code>for i in range(self.num_hl):
  
      inner2 = keras.layers.LSTM(self.hl1, dropout=self.dropout, kernel_initializer=self.kernel_init,
                                             return_sequences=True, kernel_regularizer=self.l2
                                             )(inner2)
  </code></pre>
  
  <p>However I would like to add the previous output to the current observation to make the new prediction. Hoping this way the model becomes auto-regressive.
  Can somebody help me implement this in Keras?</p>