yuqinie98 / PatchTST

An offical implementation of PatchTST: "A Time Series is Worth 64 Words: Long-term Forecasting with Transformers." (ICLR 2023) https://arxiv.org/abs/2211.14730
Apache License 2.0
1.37k stars 248 forks source link

Google Paper mentions a bug in test dataloader of PatchTST #68

Open AfrinDange opened 11 months ago

AfrinDange commented 11 months ago

Your work has provided valuable insights into time series forecasting. Recently I came across this paper: https://arxiv.org/pdf/2304.08424.pdf, which comes up with an MLP encoder-decoder model for TSF which beats PatchTST's performance on the benchmark datasets. The authors report numbers after fixing a bug in PatchTST's test data loader. I need confirmation whether the code to fix this bug is modifying the length of the dataset from

 def __len__(self):
          return len(self.data_x) - self.seq_len - self.pred_len + 1

to

def __len__(self):
        return len(self.data_x) - self.pred_len + 1

only for validation and test data loader?

yuqinie98 commented 11 months ago

Ah, thanks for mentioning that! TiDE is a good work and we also read it. This is dataloader used by most of the previous work so we keep it to make a fair comparison. Actually I am not sure about why using the second one as the length since the first one seems more reasonable. Would you mind to give your insight on that?

gorkemcanates commented 9 months ago

The original code is actually correct. The problem is when you input hourly data, it uses _minute dataset instead of _hour dataset.