(self, x)
| 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 | |
| 96 | class FourierDecomp(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected