thuml / iTransformer

Official implementation for "iTransformer: Inverted Transformers Are Effective for Time Series Forecasting" (ICLR 2024 Spotlight), https://openreview.net/forum?id=JePfAI8fah
https://arxiv.org/abs/2310.06625
MIT License
1.11k stars 195 forks source link

what is the 'label_len' in dataloader for? #101

Closed PlanckChang closed 3 weeks ago

PlanckChang commented 1 month ago
    def __getitem__(self, index):
        s_begin = index
        s_end = s_begin + self.seq_len
        r_begin = s_end - self.label_len
        r_end = r_begin + self.label_len + self.pred_len

        seq_x = self.data_x[s_begin:s_end]
        if self.inverse:
            seq_y = self.data_x[r_begin:r_begin + self.label_len]
        else:
            seq_y = self.data_y[r_begin:r_begin + self.label_len]
        seq_x_mark = self.data_stamp[s_begin:s_end]
        seq_y_mark = self.data_stamp[r_begin:r_end]

        return seq_x, seq_y, seq_x_mark, seq_y_mark

The code is in data_loader.py. I wanna know what the self.label_len for? So the history data and the prediction ground truth have some overlapped values?

Master-chenk commented 1 month ago

I also want to know.

bigdata0 commented 1 month ago

In fact, label_len does not work in the implementation of itransformer. Its existence is only for merging with the time-series library project.

mawenju203 commented 1 week ago

label_len,是根据什么定义的呢?

WenWeiTHU commented 1 week ago

label_len,是根据什么定义的呢?

please refer to https://github.com/zhouhaoyi/Informer2020