Update modeling_super_linear.py
Browse files204 unmodified lines20520620720820820921021221121221324 unmodified lines238239240243241242243247244245246204 unmodified lines if mode == 1: W = self.Linear.weight.detach() 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.0 final_scaling = 1 new_W = new_W * final_scaling
self.zero_shot_Linear = new_W24 unmodified lines #print(F"new Lookkback : {x.shape[1]}") self.transform_model(x.shape[1],1) x = x * (x.shape[1]/512) x = self.revin_layer(x, 'norm') x = F.linear(x, self.zero_shot_Linear) x = self.revin_layer(x, 'denorm') x = x * (512/x.shape[1]) return x
modeling_super_linear.py-4