thuml / Anomaly-Transformer

About Code release for "Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy" (ICLR 2022 Spotlight), https://openreview.net/forum?id=LzQQ89U1qm_
MIT License
668 stars 174 forks source link

About 'self.test_labels[0:self.win_size]' in the line 187-192 of data_loader.py #48

Open DongJKang opened 11 months ago

DongJKang commented 11 months ago

I really appreciate your work and thanks a lot for sharing this work with us!

I am now following your code step by step to understand the model and apply it to my data. And while I'm doing this, I got a question.

In the line 187-192 of data_loader.py The code is written like this.

187 def getitem(self, index):


190 return np.float32(self.train[index:index + self.win_size]), np.float32(self.test_labels[0:self.win_size]) 192 return np.float32(self.val[index:index + self.win_size]), np.float32(self.test_labels[0:self.win_size])

Shouldn't the '0' be changed to 'index'? self.test_labels[0:self.win_size] -> self.test_labels[index:index + self.win_size]

If there's anything that I missed please let me know.

maikouSart commented 11 months ago

it's not important, they don't use labels in train mode and val mode.