Looking for a way to shuffle sampling from multiple time series #2919
Unanswered
yuvalarbel
asked this question in
Q&A
Replies: 1 comment 6 replies
-
Have you tried setting the shuffle buffer length: gluonts/src/gluonts/torch/model/deepar/estimator.py Lines 339 to 345 in 1cc17c1 |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I have a dataset with multiple time series of varying lengths and start times.
I am using an
InstanceSplitter
andInstanceSampler
to get sliding windows from these time series.I am then batching these into batches for my train/val/test sets.
The problem is that batches are not shuffled - i.e all of the first batches have samples only from the first time series. This is problematic for training.
I wanted to find a way to shuffle the sampling from it.
I created a new
ShuffledInstanceSplitter
to do this (code below).Is there a better way to do this, built into GluonTS?
There are many very ugly parts of this implementation:
a. I'm saving the time series in a list so that I can access them by index, because the
PandasDataset
saves them in a starmap iteratorb. I am permuting the access indices, which means I am saving an array in memory of all optional sample indices
c. The
flatmap_transform
method of theInstanceSplitter
class is not called but also is not overridden. I didn't change it at all, I just needed to call the inner nested code block separately.Anyways, I hope this helps someone:
Beta Was this translation helpful? Give feedback.
All reactions