MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / forward

Method forward

layers/Autoformer_EncDec.py:85–93  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

83 self.layer = torch.nn.Linear(1, len(kernel_size))
84
85 def forward(self, x):
86 moving_mean=[]
87 for func in self.moving_avg:
88 moving_avg = func(x)
89 moving_mean.append(moving_avg.unsqueeze(-1))
90 moving_mean=torch.cat(moving_mean,dim=-1)
91 moving_mean = torch.sum(moving_mean*nn.Softmax(-1)(self.layer(x.unsqueeze(-1))),dim=-1)
92 res = x - moving_mean
93 return res, moving_mean
94
95
96class FourierDecomp(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected