MCPcopy Create free account
hub / github.com/cure-lab/LTSF-Linear / series_decomp

Class series_decomp

models/DLinear.py:25–36  ·  view source on GitHub ↗

Series decomposition block

Source from the content-addressed store, hash-verified

23
24
25class 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
38class Model(nn.Module):
39 """

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected