Closed hassaku closed 7 years ago
LSTM()
expects input of shape (nb_timesteps, nb_features)
but Dense outputs 1D so use Reshape()
to add a dummy dimension after the fully-connected layer or use TimeDistributed(Dense())
.
Thank you for your advice. It's solved by using TimeDistributed now.
I try to implement the following model called LSDNN.
CONVOLUTIONAL, LONG SHORT-TERM MEMORY, FULLY CONNECTED DEEP NEURAL NETWORKS http://static.googleusercontent.com/media/research.google.com/ja//pubs/archive/43455.pdf
Input -> Conv(+Pool) -> Dense (to reduce dimension) -> LSTM -> Dense -> Output
If the first Dense layer is removed, exception not occurs. But dimension isn't reduced.
How to use Dense layer keeping input shape for LSTM? Thank you for any help someone can provide.