-
Notifications
You must be signed in to change notification settings - Fork 861
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
[timeseries] Update to GluonTS v0.13.0 + add DLinear and PatchTST models #3230
Conversation
Job PR-3230-436b645 is done. |
@@ -13,6 +13,8 @@ | |||
|
|||
__all__ = [ | |||
"DeepARModel", | |||
"DLinearModel", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious if there is a particular reason or quantitative analysis supporting the inclusion of these two models
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason is supporting our commitment to provide an easy-to-use API for GluonTS models via TimeSeriesPredictor
. This is the same reason why we still keep the MXNet models around, even though they are not used in any presets.
The second reason is that the papers introducing these two models demonstrated SoTA results on some forecasting tasks. Though, we need to do proper benchmarking before including these models to the presets.
forecast_arrays.append(forecast.quantile(q)) | ||
forecast_keys.append(str(q)) | ||
# Compute all quantiles in parallel instead of a for-loop | ||
quantiles = torch.tensor(quantile_levels, device=forecast.distribution.mean.device).reshape(-1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why we need to get the device from forecast distribution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't do that, the quantiles
tensor might reside on CPU while the forecast.distribution
object is on GPU, which would lead to a device mismatch exception by PyTorch.
The code here is nearly identical to the code in DistributionForecast.quantile
, except that we compute all the quantiles simultaneously in parallel, instead of doing a for loop.
Job PR-3230-e51756a is done. |
Job PR-3230-5ca57aa is done. |
Job PR-3230-c7d464f is done. |
Description of changes:
Bump GluonTS dependency to v0.13.0.
Add two new models:
DLinear
andPatchTST
(not yet added to the presets).Clean up the logic for setting the default
context_length
for GluonTS models.Speed up the methods for converting
DistributionForecast
toQuantileForecast
by vectorizing the code over allquantile_levels
. Comparison of prediction time in seconds on M4 Quarterly (24000 time series) for SimpleFeedForward model that produces aDistributionForecast
.The overall prediction time is still rather slow and probably could be further improved, but that would require digging into the GluonTS internals.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.