Closed veds12 closed 3 years ago
Solved in #229
Have you solved this issue?
Yes. @korosig please see this:
https://github.com/jdb78/pytorch-forecasting/issues/229#issuecomment-753603424
You can define a new batch sampler class which inherits from TimeSynchronousBatchSampler
and redefine the __iter__
method with the desired stride length
Yes. @korosig please see this: #229 (comment) You can define a new batch sampler class which inherits from
TimeSynchronousBatchSampler
and redefine the__iter__
method with the desired stride length
Do you have a version with this modification somewhere? Github repo or Google colab?
Just a reminder that it's TimeSynchronizedBatchSampler
instead of TimeSynchronousBatchSampler
.
It took me some time digging into the doc, so I hope this info would help someone save some time.
How can I change the slide length of the lookback window? It is one by default, i.e., if my time series is
1, 2, 3, 4, 5, 6, 7, 8, 9
with a lookback window of length of 5 and a prediction horizon of length 2, the sampled encodings will be1, 2, 3, 4, 5
,2, 3, 4, 5, 6
and3, 4, 5, 6, 7
. However, I want to change the length of each slide s.t. the lookback window moves ahead with a stride of 2. So, the new sampled encoding will be1, 2, 3, 4, 5
and3, 4, 5, 6, 7
.I went through the API of
TimeSeriesDataSet.to_dataloader()
but could find any option / flag to change the stride size.