zhihanyue / ts2vec

A universal time series representation learning framework
MIT License
593 stars 143 forks source link

clarification on the sliding length and padding #7

Closed m13ammed closed 2 years ago

m13ammed commented 2 years ago

Thank you for your great contribution. I was unable to understand the difference in usage for the sliding length and sliding padding. For example, if I wanted to utilize X days for a forecasting problem, what would be the proper usage for the parameters be?

Thank you in advance.

sliding_length sliding_padding

Note: I noticed on my dataset that using 24 =>sliding length > 1 yields better results, however for sliding length >24 a size mismatch error occurs at evaluation. The impact for increasing the padding was less impactful than the length, so if you can clarify the proper usage it would be great.

zhihanyue commented 2 years ago
138607581-1cd58d54-7490-4912-82f4-3f6492b5a6cc

This figure illustrates the process of causal sliding inference. "sliding_length" is the step size of the sliding window. For each window, we require the representations on a slice with size "sliding_length". The "padding" only provides the contextual information for that slice, and we ignore the representation of the "padding". Commonly, sliding_length should be set to 1, and sliding_padding is the window size (i.e. X) for historical data.

m13ammed commented 2 years ago

This clears things up. Thank you