title: Simplifying a Keras LSTM model in functional API
body: <p>I have the following Keras LSTM model using functional API:</p>
  
  
  
  <pre class="lang-python prettyprint-override"><code>model = Sequential()
  model.add(Lambda(lambda x: x,input_shape=(timestep,n_feature)))
  output = model.output
  output = LSTM(8)(output)
  output = Dense(2)(output)
  
  inputTensor = model.input
  myModel = Model([inputTensor], output)
  myModel.compile(loss='mean_squared_error', optimizer='adam')
  
  myModel.fit([trainX], trainY, epochs=100, batch_size=1, verbose=2, validation_split = 0.1)
  </code></pre>
  
  <p>The model works fine but I think there are redundant syntax in my architecture. For example, the Lambda layer is only used to define the input_shape, maybe it can be removed? Can the above code be simplified/cleaned (I want to keep using functional API)? Thanks!</p>