LSTM Online Inference

I am training LSTM model using X_train of shape (5000,50,2) i.e. 5000 samples, each of 50 timesteps and 2 features.
For the testing I use similar shape of dataset i.e. X_test = (1000, 50, 2).

My question is about making predictions online i.e. in a loop to simulate real world system.
Can I use LSTM to make predictions with X_test of shape (1, 1, 2) ? and then just feed new values at each timestep?
I have tried doing that, and values of the predictions are different…

Hi @SimpleStudent. (I’m assuming you don’t want to train your model again each time new actual data arrives).I would think the appropriate way consist on having a “rolling” dataset you used at prediction time, that is everytime you get a new actual datapoint you get rid of the oldest timestamp and integrate that new actual. You do this over and over again. But maybe I don’t understand well your issue (as there doesn’t seem to be any!).