AI4HealthUOL / SSSD

Repository for the paper: 'Diffusion-based Time Series Imputation and Forecasting with Structured State Space Models'
MIT License
270 stars 47 forks source link

How to run a forecasting task? #15

Closed Nicholas0917 closed 1 year ago

Nicholas0917 commented 1 year ago

Thanks for your great work! I want to run the results of the time series forecasting experiment, but I can't seem to find the corresponding code.

juanlopezcode commented 1 year ago

you will need to adjust the code as requiered with a different dataset and masking strategy, including adjusting the config file as desired. Forecast uses a black out masking, which is randomly updated during training, so the model gets to see 'input' from all areas (use same time steps masked as you will forecast), and when inferencing just pass the mask on the forecasting/last area of the signal.

Nicholas0917 commented 1 year ago

Thanks a lot. I will have a try.

ashok-arjun commented 1 year ago

Hi @juanlopezcode I am trying to run your code for multivariate forecasting, to use your model as a baseline for probabilistic multivariate forecasting (since your paper is one of the latest models).

Can you please highlight which files I need to modify and how exactly I need to modify?

@Nicholas0917 if you have managed to run the model for forecasting, can you please let us know what worked?

Thank you very much.

juanlopezcode commented 1 year ago

Hello @ashok-arjun, imagine your ts have 100 time steps and 10 channels.

config_SSSDS4.json -change in_channels and out_channels to 10 -change s4_lmax and sample_length to 100 -change masking to bm

train.py -change the path to load desired dataset

hope it helps :)