I have built an LSTM in TensorFlow that is unrolled into n timesteps and trains successfully on sequences of lengths n.

I would now like to use my trained model to make m daily predictions one by one. One way of doing this is that for each of the m daily predictions, I would take a sliding window of length n, with the final timestep taking in the input data for this day's prediction. Each day, this window of length n is slid over by one day.

Another way I have seen is to use an LSTM unrolled into just a single timestep for these predictions. The previous n (or more or less) datapoints are passed through the single timestep LSTM one at a time to "warm up" its hidden state. Then, for each of the m prediction days, just the input data for this day is fed into the LSTM and a prediction is produced from this input and from the hidden state.

Is it possible to train an LSTM in TensorFlow which is unrolled into n timesteps, and then use a single timestep LSTM with the trained parameters to make predictions? My idea would be to train the unrolled model, save the parameters, initialize a single timestep LSTM, and populate its parameter with the stored ones. Can this be done?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.