I am using Keras with Tensorflow backend to do sequence prediction on multiple sequences simultaneously one step at a time; that is, I have n sequences each with m timesteps and I load them all into Keras with one model.predict() command and the model returns an 'n' element array with each element corresponding to the predicted next step for each of the n sequences.
So my goal is to maximize the ability for Keras to detect cross-correlations between the sequences. For example, say sequence a strongly correlates with sequence b with some time delay and scaling factor difference, then in theory Keras should be able to use sequence b to better predict the next step for sequence a. How I have it now I am testing with 4 sequences, each 30 elements long, and sending them to my model as exactly that, input data has the shape (4, 30, 1) and output data has the shape (4, 1):
model = Sequential()
model.add(LSTM(
input_shape=(30, 1),
output_dim=100,
return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(
200,
return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(
output_dim=1,
return_sequences=False))
model.add(Activation("linear"))
model.compile(loss="mse", optimizer="rmsprop")
return model
What I'm wondering is if Keras is already cross-correlating the sequences, or if my model currently views them as independent and just predicts them all at the same time (i.e. it would be the same as predicting the next step for sequence a, then b, then c, etc.). Would Keras be able to better cross-correlate the sequences if I treated them as 1 sequences with n features per time-step (that is, input data of shape (1, 30, 4) and output data of shape (1, 4))? And if so would I still be able to output an n-element array with each element still being correlated to one of the input arrays (i.e. would they maintain distinguish-ability)?
Thanks!