QData / spacetimeformer

Multivariate Time Series Forecasting with efficient Transformers. Code for the paper "Long-Range Transformers for Dynamic Spatiotemporal Forecasting."
https://arxiv.org/abs/2109.12218
MIT License
808 stars 191 forks source link

One sample missed? #32

Closed qAp closed 2 years ago

qAp commented 2 years ago

https://github.com/QData/spacetimeformer/blob/7e0caf17dd03e5d25e2766c4f7132805779bcc40/spacetimeformer/data/csv_dataset.py#L155

If total length is 10, context length is 3, and target length is 2. Then, the last possible starting index is 5, with context = [5, 6, 7] and target = [8, 9]. But range(10 - 3 - 2) doesn't include 5.

jakegrigsby commented 2 years ago

Thanks yeah looks like we're leaving out the final timestep of each dataset split. I added +1 to that range, should be in the next PR.