MCPcopy Create free account
hub / github.com/kwuking/TimeMixer / series_decomp

Class series_decomp

layers/Autoformer_EncDec.py:41–53  ·  view source on GitHub ↗

Series decomposition block

Source from the content-addressed store, hash-verified

39
40
41class 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
56class series_decomp_multi(nn.Module):

Callers 5

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected