Update modeling_super_linear.py
Browse files209 unmodified lines2102112122132142132142152162175 unmodified lines223224225226227228229230231232233234235236237238239240241242243244209 unmodified lines new_W = new_W * final_scaling
self.zero_shot_Linear = new_W else: W = self.Linear.weight.detach() elif mode ==2: W = self.Linear.weight.detach() W4d = W.unsqueeze(0).unsqueeze(0) # (1, 1, out, in)
# resize H → self.horizon and W → new_lookback5 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 = W[:, -new_lookback:] W4d = W.unsqueeze(0).unsqueeze(0) # (1, 1, out, in)
# resize H → self.horizon and W → new_lookback new_W = F.interpolate( W4d, size=(self.seq_len , new_lookback), # (H_out, W_out) mode='bilinear', align_corners=False )[0, 0] # drop the two singleton dims
W_now = torch.cat((W, new_W), dim=1) self.zero_shot_Linear = new_W
modeling_super_linear.py+18-2