deep-learning
keras
keras-layer
lstm
12
0

``````model = Sequential()
``````

Stack Overflow

``````# expected input data shape: (batch_size, timesteps, data_dim)
model = Sequential()
input_shape=(timesteps, data_dim)))  # returns a sequence of vectors of dimension 32
model.add(LSTM(32, return_sequences=True))  # returns a sequence of vectors of dimension 32
model.add(LSTM(32))  # return a single vector of dimension 32
``````

``````# expected input data shape: (batch_size, timesteps, data_dim)
model = Sequential()
input_shape=(timesteps, data_dim)))  # returns a sequence of vectors of dimension 32
model.add(LSTM(32, return_sequences=True))  # returns a sequence of vectors of dimension 32
model.add(LSTM(32))  # return a single vector of dimension 32