Update modeling_super_linear.py
Browse files- modeling_super_linear.py +4 -5
modeling_super_linear.py
CHANGED
|
@@ -512,7 +512,7 @@ class superLinear(nn.Module):
|
|
| 512 |
B, V, L = x.shape
|
| 513 |
else:
|
| 514 |
x = x_enc
|
| 515 |
-
|
| 516 |
B, L = x.shape
|
| 517 |
V = 1
|
| 518 |
|
|
@@ -525,11 +525,10 @@ class superLinear(nn.Module):
|
|
| 525 |
orig_pred_len = inf_pred_len
|
| 526 |
|
| 527 |
inf_pred_len = inf_pred_len*scale_factor
|
| 528 |
-
|
| 529 |
-
x = interpolate(x_enc, scale_factor=scale_factor, mode='linear')
|
| 530 |
|
| 531 |
-
|
| 532 |
-
x = x[
|
| 533 |
orig_L = L
|
| 534 |
L = self.seq_len
|
| 535 |
|
|
|
|
| 512 |
B, V, L = x.shape
|
| 513 |
else:
|
| 514 |
x = x_enc
|
| 515 |
+
x_enc = x_enc.unsqueeze(-1)
|
| 516 |
B, L = x.shape
|
| 517 |
V = 1
|
| 518 |
|
|
|
|
| 525 |
orig_pred_len = inf_pred_len
|
| 526 |
|
| 527 |
inf_pred_len = inf_pred_len*scale_factor
|
| 528 |
+
x = interpolate(x_enc.permute(0, 2, 1), scale_factor=scale_factor, mode='bicubic')
|
|
|
|
| 529 |
|
| 530 |
+
|
| 531 |
+
x = x[:,: , -self.seq_len:]
|
| 532 |
orig_L = L
|
| 533 |
L = self.seq_len
|
| 534 |
|