'How to correctly configure Encoder Decoder LSTM to have one timestep output carrying multiple features

In each observation, I have 6 timesteps each with 2 features, and I am trying to predict 1 timetsep that has 2 parallel features. More specifically,

The shape of my input data is: (81, 6, 2) The shape of my output data is: (81, 1, 2)

I wrote the following code to build Encoder-Decoder LSTM:

model.add(LSTM(200, activation='relu', input_shape=(n_input, 2)))
model.add(RepeatVector(1))
model.add(LSTM(200, activation='relu', return_sequences=True))
model.add(TimeDistributed(Dense(100, activation='relu')))
model.add(TimeDistributed(Dense(2)))

The network gives me back the shape (1, 1, 2) when I perform a single prediction.

I want to double check if this is correct, and I am not missing anything, because the predicted values are very bad (some are negative and others are very high).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source