Series decomposition block
| 39 | |
| 40 | |
| 41 | class series_decomp(nn.Module): |
| 42 | """ |
| 43 | Series decomposition block |
| 44 | """ |
| 45 | |
| 46 | def __init__(self, kernel_size): |
| 47 | super(series_decomp, self).__init__() |
| 48 | self.moving_avg = moving_avg(kernel_size, stride=1) |
| 49 | |
| 50 | def forward(self, x): |
| 51 | moving_mean = self.moving_avg(x) |
| 52 | res = x - moving_mean |
| 53 | return res, moving_mean |
| 54 | |
| 55 | |
| 56 | class series_decomp_multi(nn.Module): |