Update modeling_super_linear.py
Browse files211 unmodified lines2122132142152152162172186 unmodified lines2252262272282292302312322332342352362373 unmodified lines241242243237244245246247211 unmodified lines new_W = new_W * final_scaling
self.zero_shot_Linear = new_W else: elif mode ==2: W = self.Linear.weight.detach() W4d = W.unsqueeze(0).unsqueeze(0) # (1, 1, out, in)
6 unmodified lines )[0, 0] # drop the two singleton dims
self.zero_shot_Linear = new_W # shape (self.horizon, new_lookback) else: W = self.Linear.weight.detach() W_3d = W.t().unsqueeze(0) W_pool = F.adaptive_avg_pool1d(W_3d, output_size=new_lookback) W_new = W_pool.squeeze(0).permute(2, 0).contiguous() self.zero_shot_Linear =
def forward(self, x):3 unmodified lines #if self.zero_shot_Linear is None: #print(F"new Lookkback : {x.shape[1]}") self.transform_model(x.shape[1],1) self.transform_model(x.shape[1],3)
x = x.clone() #x = x * (x.shape[1]/512)modeling_super_linear.py+9-2