I'm trying to understand the basics of the LSTM's and I built this model:
self.model = Sequential()
self.model.add(LSTM(self.config.layers[0],
input_shape=(None, channel.X_train.shape[2]),
return_sequences=True))
self.model.add(Dropout(self.config.dropout))
self.model.add(LSTM(
self.config.layers[1],
return_sequences=True))
self.model.add(Dropout(self.config.dropout))
self.model.add(Dense(
self.config.n_predictions))
self.model.add(Activation('linear'))
The input shape is (2000, 200, 10) and I need an output of the same shape. I tried on this way but I got the error:
ValueError: Input 0 is incompatible with layer lstm_2: expected ndim=3, found ndim=2
If I set to False the return_sequence parameter of the second layer it works, but I get an output of shape (X, Y), which is not what I want.