Update modeling_super_linear.py
Browse files97 unmodified lines9899100101102103104105106107108109110101102103104105122 unmodified lines2282292302392312322332341 unmodified line23623723824723924024124297 unmodified lines super(moving_avg, self).__init__() self.kernel_size = kernel_size self.avg = nn.AvgPool1d(kernel_size=kernel_size, stride=stride, padding=0) """ def forward(self, x): # padding on the both ends of time series front = x[:, 0:1, :].repeat(1, (self.kernel_size - 1) // 2, 1) end = x[:, -1:, :].repeat(1, (self.kernel_size - 1) // 2, 1) x = torch.cat([front, x, end], dim=1) x = self.avg(x.permute(0, 2, 1)) x = x.permute(0, 2, 1) return x """
def forward(self, x): # x: [Batch, Input length] # padding on the both ends of time series122 unmodified lines def forward(self, x): # x: [Batch, Input length,Channel] x_shape = x.shape if x.shape[1] < self.seq_len: ''''if x.shape[1] < self.seq_len: #if self.zero_shot_Linear is None: #print(F"new Lookkback : {x.shape[1]}") 1 unmodified line x = self.revin_layer(x, 'norm') x = F.linear(x, self.zero_shot_Linear) x = self.revin_layer(x, 'denorm') return x return x'''
if len(x_shape) == 2:modeling_super_linear.py+4-12