I was just wondering if there is an existing convenience function in Pytorch for forecasting n timesteps ahead, given a model.
For example in the R forecast package, you can fit a model and then indicate forecast(h=10) and it will forecast the next 10 timesteps given the model.
The algorithm itself is very simple–here is a toy example. Say you have a model based on 7 days inputs and you predict the next 3 days as output. Further, say you want to predict the next year, so 365 days. The you would use the last 7 input values from your dataset and predict the next 3 days–meaning you now have the first 3 days of the 365. Then you would append these predictions to the end of your input dataset and predict the subsequent 3 days. So now you have 6 days out of your 365 day prediction. So you would do this predict-and-append loop for 365//3 = 122 timesteps (or perhaps just 121 steps) and obtain your predictions for the full 365.
Now writing the loop is not too difficult, given the algorithm above. But instead of reinventing the wheel, I figured I would check if there is already some sort of convenience function for this in Pytorch. Also, I imagine that I could probably run this prediction loop on the CPU instead of having to push to the GPU each time–that might save some of the data transfer and improve the speed, depending on data volume and number of prediction steps, etc?
Thanks.