(self, configs)
| 40 | Decomposition-Linear |
| 41 | """ |
| 42 | def __init__(self, configs): |
| 43 | super(Model, self).__init__() |
| 44 | self.seq_len = configs.seq_len |
| 45 | self.pred_len = configs.pred_len |
| 46 | |
| 47 | # Decompsition Kernel Size |
| 48 | kernel_size = 25 |
| 49 | self.decompsition = series_decomp(kernel_size) |
| 50 | self.individual = configs.individual |
| 51 | self.channels = configs.enc_in |
| 52 | |
| 53 | if self.individual: |
| 54 | self.Linear_Seasonal = nn.ModuleList() |
| 55 | self.Linear_Trend = nn.ModuleList() |
| 56 | |
| 57 | for i in range(self.channels): |
| 58 | self.Linear_Seasonal.append(nn.Linear(self.seq_len,self.pred_len)) |
| 59 | self.Linear_Trend.append(nn.Linear(self.seq_len,self.pred_len)) |
| 60 | |
| 61 | # Use this two lines if you want to visualize the weights |
| 62 | # self.Linear_Seasonal[i].weight = nn.Parameter((1/self.seq_len)*torch.ones([self.pred_len,self.seq_len])) |
| 63 | # self.Linear_Trend[i].weight = nn.Parameter((1/self.seq_len)*torch.ones([self.pred_len,self.seq_len])) |
| 64 | else: |
| 65 | self.Linear_Seasonal = nn.Linear(self.seq_len,self.pred_len) |
| 66 | self.Linear_Trend = nn.Linear(self.seq_len,self.pred_len) |
| 67 | |
| 68 | # Use this two lines if you want to visualize the weights |
| 69 | # self.Linear_Seasonal.weight = nn.Parameter((1/self.seq_len)*torch.ones([self.pred_len,self.seq_len])) |
| 70 | # self.Linear_Trend.weight = nn.Parameter((1/self.seq_len)*torch.ones([self.pred_len,self.seq_len])) |
| 71 | |
| 72 | def forward(self, x,edge_index=None, edge_attr=None): |
| 73 | # x: [Batch, Input length, Channel] |
no test coverage detected