-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What Lags you use when pre-training the lag-llama? #36
Comments
Also, I do not fully understand how the model gets the prediction for multiple future time points autoregressively at inference time. Say I want to make 3 future predictions, and 100 trajectories, does it work as follows? for _ in range(100):
Additionally, it would be great if you could give me a hint on where I can find the detail code for autoregressive prediction, thanks! |
lag-llama/lag_llama/gluon/lightning_module.py Lines 229 to 261 in 7454088
|
Hi @SpeeeedLee . The 32 historical time series points are consecutive, and sampled before the timestep to be predicted. The lags however are sampled possibly even beyond this 32-length context, but sparsely as denoted by the lag indices. As for the indices of the lags, in our experiments, we sample lags of certain frequencies, upto a certain length. The frequencies are denoted here: lag-llama/lag_llama/gluon/estimator.py Line 137 in 35f62a9
The corresponding code to sample lags is here. We use the get_lags_for_frequency function of GluonTS in our code: lag-llama/lag_llama/gluon/estimator.py Lines 158 to 161 in 35f62a9
To give an example, the lags of the "D" frequency (daily) frequency look like this:
As for the actual lag indices that come from all these frequencies:
For the code GluonTS uses to generate these lag indices, you can refer to the source code of the get_lags_for_frequency function. |
Feel free to follow up if you have clarifications or close the issue if it answers your questions. Thanks! |
Hi guys, I actually wanna run pre-trained model and I find if I want to load lags_seq from pre-trained model. For example: |
Hi, Should I adjust lags_seq based on the frequency of my time series? For daily data, is it correct to use lags_seq = ["Q", "M", "W", "D"] and exclude hour, minute, and second lags since they might not make sense for daily intervals? Thanks for your help. |
@YuMeng2v The lags sequence cannot be modified for a pretrained model. So if you're loading from the released model, If you are training your own model from scratch (not finetuning), you may set that parameter using the frequencies. |
@arthur-b1 The model uses all lags as it is a generic model independent of the frequency. The lags cannot be modified for a trained model as the first MLP depends on the number of lags. For your own data, ideally the most useful lag would be that of your frequency, but the other lags shouldn't affect it. |
Thank you! I didn't pass the ckpt path to the estimator, I think it's actually pre-train?
|
You are passing the
|
Hi, just checking if this issue is resolved. |
Hello, it's Arthur,
Thank you for your great work.
I would like to ask whether it is possible to get the specific lag indices you use during the pre-training or zero-shot phases.
In the Colab tutorial notebook, it is indicated that the context length is set to 32, and the maximum potential lag index could be 1092. However, the exact indices used to tokenize the 32 historical time points remain unclear to me.
Do you employ all of the 1092 lags, or is there a specific subset that is used?
Thank you!
The text was updated successfully, but these errors were encountered: