Add dense layer before LSTM layer in keras or Tensorflow?
问题 I am trying to implement a denoising autoencoder with an LSTM layer in between. The architecture goes following. FC layer -> FC layer -> LSTM cell -> FC layer -> FC layer. I am unable to understand how my input dimension should be to implement this architecture? I tried the following code batch_size = 1 model = Sequential() model.add(Dense(5, input_shape=(1,))) model.add(Dense(10)) model.add(LSTM(32)) model.add(Dropout(0.3)) model.add(Dense(5)) model.add(Dense(1)) model.compile(loss='mean