https://github.com/nixtla logo
#neural-forecast
Title
# neural-forecast
a

Asterios Tsiourvas

04/12/2023, 3:32 PM
Hello team. Is there an implementation of the DeepAR Forecasting Algorithm in the neuralforecast ? Thanks!
k

Kin Gtz. Olivares

04/12/2023, 3:42 PM
Hey @Asterios Tsiourvas, I was working a month ago on the DeepAR model inclusion, and left the project unconcluded. For the moment the only thing that is missing to have a DeepAR is to work on a recurrent decoder that uses LSTM rather than MLPs. For the moment we have an
LSTM
model that operates closely to the DeepAR with the decoder difference. Here is its documentation: https://nixtla.github.io/neuralforecast/models.lstm.html
Out of curiosity are you working on baselines for a paper or are you trying to get good performing methods? It is my belief that DeepAR prediction's accuracy and speed have been surpassed by various methods already available in NeuralForecast.
a

Asterios Tsiourvas

04/12/2023, 3:55 PM
@Kin Gtz. Olivares Thank you for your response! Yes, I am working on reproducing the results of a paper. So, if
k

Kin Gtz. Olivares

04/12/2023, 3:56 PM
You may want to check this GluonTS example: https://ts.gluon.ai/stable/
a

Asterios Tsiourvas

04/12/2023, 3:56 PM
If i replace the mlp_decoder with a lstm_decoder in lstm.py, then I would get the DeepAR model? Moreover, which other methods would you suggest?
k

Kin Gtz. Olivares

04/12/2023, 3:57 PM
If you aim to achieve recognition in the quality of your baselines, I would go for NBEATS (Bengio), TFT (Google).
If you want to help us with citations, and use good performing models NBEATSx, NHITS are good baselines too.
LSTM is almost needed, as is one of the most classic methods
And if you want to increase the seriousness of the baselines, I would include an ARIMA/ETS
a

Asterios Tsiourvas

04/12/2023, 4:01 PM
Got it! Thanks so much! Do you think it is straightforward to replace the mlp_decoder with a lstm_decoder in lstm.py?
c

Cristian (Nixtla)

04/12/2023, 4:20 PM
There are still several differences to how DeepAR works, so it wont be completely comparable. DeepAR simulate trajectories with a recursive strategy, our method produce all the forecasts simutanously. Also I believe DeepAR does not have a decoder, it is basically a simple LSTM.
Here is the recursive sampling strategy.
k

Kin Gtz. Olivares

04/12/2023, 4:46 PM
LSTM decoder 🙂
It is a Seq-to-Seq method in its purest form
c

Cristian (Nixtla)

04/12/2023, 4:59 PM
Yes, but I what I meant @Kin Gtz. Olivares @Asterios Tsiourvas is that you dont need to "add" an LSTM as decoder instead of MLPs, because DeepAR consists of only one LSTM. You will need to remove the MLP decoders and only keep de LSTM, and use a Distribution Loss. Still, because of the recursive strategy and sampling it wont be exactly the same.
a

Asterios Tsiourvas

04/12/2023, 5:32 PM
I see. Thank you both for your help!!