Series decomposition block
| 23 | |
| 24 | |
| 25 | class series_decomp(nn.Module): |
| 26 | """ |
| 27 | Series decomposition block |
| 28 | """ |
| 29 | def __init__(self, kernel_size): |
| 30 | super(series_decomp, self).__init__() |
| 31 | self.moving_avg = moving_avg(kernel_size, stride=1) |
| 32 | |
| 33 | def forward(self, x): |
| 34 | moving_mean = self.moving_avg(x) |
| 35 | res = x - moving_mean |
| 36 | return res, moving_mean |
| 37 | |
| 38 | class Model(nn.Module): |
| 39 | """ |