time-series-foundation-models / lag-llama

Lag-Llama: Towards Foundation Models for Probabilistic Time Series Forecasting
Apache License 2.0
1.2k stars 146 forks source link

Inference with long sequence dataset #99

Open chohs1221 opened 3 weeks ago

chohs1221 commented 3 weeks ago

Hi, thanks for the project. I am really interested in it.

But while finetuning with my own dataset, I've got confused.

Here's what I understood:

  1. The model's input is a window of size {context_length}
  2. During training step, the model forecasts the sequence length of {prediction_length} at once.
  3. When inference(prediction), the model forecasts one at a time autoregressively for length of {prediction_length} Am I understanding right?

And how can I forecast long sequences? For example, I have fintuned the model and have 100k sequences of time series dataset for test. I want to forecast(predict) all of them except the first {context_size} of test dataset. Should I just get {prediction_length} larger? or am I understanding something wrong?

Thank you, hope for your reply.

ashok-arjun commented 3 weeks ago

When finetuning, you can use the specific prediction length you want to finetune for. You can set it in the run script as --prediction_length.

At inference, you can always set a different (larger or smaller) prediction length too.

chohs1221 commented 3 weeks ago

Thanks for the reply. Do you mean it is possible to autoregressively predict 100k of sequences at once by setting prediction_length 100k?

ashok-arjun commented 3 weeks ago

That's the only way supported now.

chohs1221 commented 3 weeks ago

Sorry, but I beg you for few more questions please.

  1. I tried to predict all 100k of sequences but when I set prediction_length up to 100k, list(forecast_id) didn't work for more than 3 hours. Is there a problem with my process?
  2. Or if 1. is impossible, is there a way to get results(predicted forecast_id) without making PandasDataset to List?

Thanks.

ashok-arjun commented 2 weeks ago
  1. 100k is possible but too long. I suggest starting very small and incrementally increasing prediction length
  2. Nope, unfortunately