Multi-Step ahead Forecasting with encoder-decoder

I am trying to develop an encoder-decoder model and perform multi-step ahead forecasting with a look back window also included. My results look weird, and I am not sure about the reshaping steps and also the structure of my model.

First, you can see the structure of my model where I will have two different inputs and I use a single encoder to capture information from both of them. Then I use two different decoders, to predict two different output parameters (time series obtained from different sensors).

visible1 = Input(shape=(num_steps_look_back, 1))
visible2 = Input(shape=(num_steps_look_back, 1))

# Concatenate the input layers
concatenated = Concatenate(axis=2)([visible1, visible2])

# Encoder LSTM with Dropout
encoder = GRU(100, activation='relu')(concatenated)
#encoder = Dropout(0.1)(encoder)

# Decoder1 LSTM with RepeatVector and Dropout
decoder1 = RepeatVector(num_steps_ahead)(encoder)
decoder1 = LSTM(100, activation='relu', return_sequences=True)(decoder1)
decoder1 = Dropout(0.1)(decoder1)
decoder1 = TimeDistributed(Dense(1))(decoder1)

# Decoder2 LSTM with RepeatVector and Dropout
decoder2 = RepeatVector(num_steps_ahead)(encoder)
decoder2 = LSTM(100, activation='relu', return_sequences=True)(decoder2)
decoder2 = Dropout(0.1)(decoder2)
decoder2 = TimeDistributed(Dense(1))(decoder2)


model = Model(inputs=[visible1, visible2], outputs=[decoder1, decoder2])

Below is the code I use to create the sequencies (the example shows for testing but I have used the same for training).

for i in range(0, len(coldtrap_test) - num_steps_look_back - num_steps_ahead + 1,num_steps_ahead):
    x_sequence_te_c = coldtrap_test[i:i + num_steps_look_back, 0]
    y_sequence_te_c = coldtrap_test[i + num_steps_look_back:i + num_steps_look_back + num_steps_ahead, 0]
    final_x_test_coldtrap.append(x_sequence_te_c)
    final_y_test_coldtrap.append(y_sequence_te_c)

Before I predict with my model, I use the following code for reshaping:

final_x_test_coldtrap = np.array(final_x_test_coldtrap)
final_x_test_coldtrap = np.reshape(final_x_test_coldtrap, (final_x_test_coldtrap.shape[0], num_steps_look_back, 1))
final_y_test_coldtrap = np.array(final_y_test_coldtrap)

Finally, after predicting:

# Reshape predictions arrays
predictions_coldtrap = np.squeeze(predictions_coldtrap, axis=2)


# Inverse transform the predictions for coldtrap and heatup data
unscaled_predictions_coldtrap = scaler.inverse_transform(predictions_coldtrap)
unscaled_y_test_coldtrap = scaler.inverse_transform(final_y_test_coldtrap)


# Calculate RMSE
rmse_coldtrap = math.sqrt(mean_squared_error(unscaled_y_test_coldtrap.flatten(), unscaled_predictions_coldtrap.flatten()))


# Plot predictions vs real data for coldtrap
plt.figure(figsize=(12, 7))
plt.plot(unscaled_predictions_coldtrap.flatten(), color='#135485', label='Predictions-Coldtrap')
plt.plot(unscaled_y_test_coldtrap.flatten(), color='red', label='Real Data-Coldtrap')
plt.legend()
plt.xlabel('Time (s)')
plt.ylabel('Temperature (°C)')

Is the procedure correct? I don’t want to have overlapping predictions (multiple predictions for a specific timestep that I want to predict). I am concerned because my output for 5 steps ahead for example looks like I have many predictions for each timestep.

enter image description here

I am trying to understand how reshaping and dimensions in multi-step ahead forecasting works.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật