Update modeling_super_linear.py
Browse files203 unmodified lines20420520620720820720820921021115 unmodified lines227228229230230231232203 unmodified lines def transform_model(self,new_lookback,mode): if mode == 1: W = self.Linear.weight.detach() #new_W = W[:, -new_lookback:] new_W = W[:, :new_lookback] new_W = W[:, -new_lookback:] #new_W = W[:, :new_lookback] original_norm = torch.norm(W, p=2) new_norm = torch.norm(new_W, p=2) final_scaling = original_norm / new_norm if new_norm.item() != 0 else 1.015 unmodified lines self.zero_shot_Linear = new_W # shape (self.horizon, new_lookback)
def forward(self, x): # x: [Batch, Input length,Channel] x_shape = x.shapemodeling_super_linear.py+2-3