-
Notifications
You must be signed in to change notification settings - Fork 973
Description
Is your feature request related to a current problem? Please describe.
Currently, sampling from torch-based, auto-regressive QuantileRegression
models is slow and consumes a great amount of memory.
Allowing predict_likelihood_parameters
for auto-regressive QuantileRegression
could skip Monte Carlo sampling entirely and speed up forecasting.
The issues has been explored previously in #2731, but I would like to re-open the issue here. I think a slight alternation to the solution might lead to better results.
Describe proposed solution
-
model.predict()
allowspredict_likelihood_parameters=True
andn>output_chunk_length
only whennum_samples=1
andmodel.likelihood
isQuantileRegression
(for now, other likelihoods could be explored in the future). - Inside
PLForecastingModule.predict_step()
when making auto-regressive, batch prediction, appends the median ($q=0.5$ ) prediction to the target.
This is also a common sampling approach with some of the latest deep learning models, such as Chronos-Bolt, TimesFM, etc.
Describe potential alternatives
We could also set num_samples=len(quantiles)
for model.predict()
. When appending the prediction, we first get new quantiles from such those samples and use those new quintiles as the new samples for target. However, this may add great complexity to the implementation since the samples might be spread across different batches.
Additional context
I tried replicating the experiment in #2731 (the best I could) and am getting better convergence than before. However, my model might not have the same hyper-parameters as @dennisbader, so please take that with a grain of salt.
input_chunk_length=24
output_chunk_length=12
quantiles=[0.1, 0.5, 0.9]
- "forecast sampled" is plotted with
[0.1, 0.9]
quantiles.
On the other hand and fundamentally, this is a different sampling method than Monte Carlo. Divergence should be small but is expected over longer auto-regressive horizons.
