I am trying to develop an LSTM autoencoder for time series forecasting using three different datasets (A: heatup, B: coldtrap, C: filling). I will train the model on data from dataset A and also on data from dataset B. I will then test the model on data from dataset B (another part of it) and data from dataset C. My goal is to have a model where dataset B along with dataset A will help in getting better predictions for dataset B and C, instead of just having dataset A and predict dataset C.
-
Since I am using two different datasets for training, should I concatenate them, fit a scaler on them and then use this scaler to transform my testing data?
-
Is it correct if my autoencoder has two input layers (for dataset A and B) and then use a concatenate layer to pass the result to the shared encoder?
This is my code for the architecture of the model:
visible1 = Input(shape=(None, 1))
visible2 = Input(shape=(None, 1))
concatenated = Concatenate(axis=1)([visible1, visible2])
encoder = LSTM(100, activation='relu')(concatenated)
encoded1 = encoder(visible1)
encoded2 = encoder(visible2)
# define predict decoder1
decoder1 = RepeatVector(1)(encoder)
decoder1 = LSTM(10, activation='relu', return_sequences=True)(decoder1)
decoder1 = TimeDistributed(Dense(1))(decoder1)
# define predict decoder2
decoder2 = RepeatVector(1)(encoder)
decoder2 = LSTM(200, activation='relu', return_sequences=True)(decoder2)
decoder2 = TimeDistributed(Dense(1))(decoder2)
# tie it together
model = Model(inputs=[visible1,visible2], outputs=[decoder1, decoder2])
This is the code for training:
history = model.fit([x_coldtrap_train, x_heatup_train], [y_coldtrap_train, y_heatup_train],
epochs=50, batch_size=320, validation_split=0.1,
verbose=1, callbacks=[early_stopping])
This one is for testing:
predictions_coldtrap,predictions_filling = model.predict([final_x_test_coldtrap,final_x_test_filling])
I have tried training and testing this model but I am not sure if its architecture is correct.