Is it possible to implement a one-to-many LSTM in Keras?
If yes, can you please provide me with a simple example?
In general, there are no guidelines on how to determine the number of layers or the number of memory cells in an LSTM. The number of layers and cells required in an LSTM might depend on several aspects of the problem: The complexity of the dataset, such as the number of features, the number of data points, etc.
The original LSTM model is comprised of a single hidden LSTM layer followed by a standard feedforward output layer. The stacked LSTM is an extension to this model that has multiple hidden LSTM layers where each layer contains multiple memory cells.
When return_sequences parameter is True, it will output all the hidden states of each time steps. The ouput is a 3D array of real numbers. The third dimension is the dimensionality of the output space defined by the units parameter in Keras LSTM implementation.
The results show that additional training of data and thus BiLSTM-based modeling offers better predictions than regular LSTM-based models. More specifically, it was observed that BiLSTM models provide better predictions compared to ARIMA and LSTM models.
It's possible with a RepeatVector
layer. For example:
model = Sequential()
model.add(Dense(10, input_shape=(1))
model.add(RepeatVector(10))
model.add(LSTM(1, return_sequences=True))
Then - the input shape is (1)
and the output is (10, 1)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With