title: LSTM Initial state from Dense layer
body: <p>I am using a <code>lstm</code> on time series data. I have features about the time series that are not time dependent. Imagine company stocks for the series and stuff like company location in the non-time series features. This is not the usecase, but it is the same idea. For this example, let's just predict the next value in the time series.</p>
  
  <p>So a simple example would be:</p>
  
  <pre><code>feature_input = Input(shape=(None, data.training_features.shape[1]))
  dense_1 = Dense(4, activation='relu')(feature_input)
  dense_2 = Dense(8, activation='relu')(dense_1)
  
  series_input = Input(shape=(None, data.training_series.shape[1]))
  lstm = LSTM(8)(series_input, initial_state=dense_2)
  out = Dense(1, activation="sigmoid")(lstm)
  
  model = Model(inputs=[feature_input,series_input], outputs=out)
  model.compile(loss='mean_squared_error', optimizer='adam', metrics=["mape"])
  </code></pre>
  
  <p>however, I am just not sure on how to specify the initial state on the list correctly. I get </p>
  
  <pre><code>ValueError: An initial_state was passed that is not compatible with `cell.state_size`. Received `state_spec`=[&lt;keras.engine.topology.InputSpec object at 0x11691d518&gt;]; However `cell.state_size` is (8, 8)
  </code></pre>
  
  <p>which I can see is caused by the 3d batch dimension. I tried using Flatten, Permutation, and Resize layers but I don't believe that is correct. What am I missing and how can I connect these layers?</p>