zalandoresearch / pytorch-ts

PyTorch based Probabilistic Time Series forecasting framework based on GluonTS backend
MIT License
1.2k stars 190 forks source link

TimeGrad: Adding Covariates as Conditioning Input #169

Open ClaraGrthns opened 2 weeks ago

ClaraGrthns commented 2 weeks ago

Hi there,

I was wondering whether it is possible to add covariates into the conditioning part of the TimeGrad implementation? It seems to me as if the transformations that are done automatically inside the time_grad_estimator for time features and lagged sequences are used as conditioning input, but how could I incorporate further covariates (i.e. of the type FieldName.feat_dynamic_real), that I don't want to forecast.

Thanks in advance!

kashif commented 2 weeks ago

so @ClaraGrthns yes the model does take in date-time features and lags as covariates, to add further covariates one can have a look at how that is done for the multivariate setting in the deepAR model in the 0.7.0 branch...

i didn't see the need to add further covaraites in the multivariate setting... even lags are too much as each lag index causes the multivariate dim to go up by the multivariate dim which can be high especially for datasets of multivariate size 2K or more...

also there was no need to add an id for each variate as the order of the variate is kept fixed...

but yeah if you have more covariates for your data, then just concat them to the input vectors as in the deepAR setting...

2ySong commented 1 week ago

so @ClaraGrthns yes the model does take in date-time features and lags as covariates, to add further covariates one can have a look at how that is done for the multivariate setting in the deepAR model in the 0.7.0 branch...

i didn't see the need to add further covaraites in the multivariate setting... even lags are too much as each lag index causes the multivariate dim to go up by the multivariate dim which can be high especially for datasets of multivariate size 2K or more...

also there was no need to add an id for each variate as the order of the variate is kept fixed...

but yeah if you have more covariates for your data, then just concat them to the input vectors as in the deepAR setting...

hello,The predictor outputs all nans in the TimeGrad. Could you slove it? thanks.