Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Beitner committed Mar 22, 2022
1 parent ceee520 commit 8823531
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions pytorch_forecasting/models/nhits/sub_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,6 @@
import torch.nn.functional as F


class RepeatVector(nn.Module):
"""
Receives x input of dim [N,C], and repeats the vector
to create tensor of shape [N, C, K]
: repeats: int, the number of repetitions for the vector.
"""

def __init__(self, repeats):
super(RepeatVector, self).__init__()
self.repeats = repeats

def forward(self, x):
x = x.unsqueeze(-1).repeat(1, 1, self.repeats)
return x


class StaticFeaturesEncoder(nn.Module):
def __init__(self, in_features, out_features):
super().__init__()
Expand All @@ -34,20 +18,6 @@ def forward(self, x):
return x


class sEncoder(nn.Module):
def __init__(self, in_features, out_features, context_length):
super().__init__()
layers = [nn.Dropout(p=0.5), nn.Linear(in_features=in_features, out_features=out_features), nn.ReLU()]
self.encoder = nn.Sequential(*layers)
self.repeat = RepeatVector(repeats=context_length)

def forward(self, x):
# Encode and repeat values to match time
x = self.encoder(x)
x = self.repeat(x) # [N,S_out] -> [N,S_out,T]
return x


class IdentityBasis(nn.Module):
def __init__(self, backcast_size: int, forecast_size: int, interpolation_mode: str):
super().__init__()
Expand Down

0 comments on commit 8823531

Please sign in to comment.