cure-lab / SCINet

The GitHub repository for the paper: “Time Series is a Special Sequence: Forecasting with Sample Convolution and Interaction“. (NeurIPS 2022)
Apache License 2.0
617 stars 127 forks source link

你好,在financial_dataloader.py中,好像没有用到horizon参数,但是我看运行命令中,有使用horizon参数,请问是我理解有问题嘛 #40

Closed SCXCLY closed 2 years ago

SCXCLY commented 2 years ago

def _batchify(self, idx_set, horizon): n = len(idx_set) X = torch.zeros((n, self.P, self.m)) Y = torch.zeros((n, self.h, self.m)) for i in range(n): end = idx_set[i] - self.h + 1 start = end - self.P X[i, :, :] = torch.from_numpy(self.dat[start:end, :])

Y[i, :, :] = torch.from_numpy(self.dat[idx_set[i] - self.h:idx_set[i], :])

        Y[i, :, :] = torch.from_numpy(self.dat[end:(idx_set[i]+1), :])
VEWOXIC commented 2 years ago

抱歉 这里是我们代码不够规范. 我们直接用了属性self.h进行运算, 实际上horizon和self.h是一样的 (详见此文件的72~74行) .

SCXCLY commented 2 years ago

谢谢您及时的解答。我已经理解了~ 谢谢~