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

Class series_decomp_multi

layers/Autoformer_EncDec.py:56–76  ·  view source on GitHub ↗

Multiple Series decomposition block from FEDformer

Source from the content-addressed store, hash-verified

54
55
56class series_decomp_multi(nn.Module):
57 """
58 Multiple Series decomposition block from FEDformer
59 """
60
61 def __init__(self, kernel_size):
62 super(series_decomp_multi, self).__init__()
63 self.kernel_size = kernel_size
64 self.series_decomp = [series_decomp(kernel) for kernel in kernel_size]
65
66 def forward(self, x):
67 moving_mean = []
68 res = []
69 for func in self.series_decomp:
70 sea, moving_avg = func(x)
71 moving_mean.append(moving_avg)
72 res.append(sea)
73
74 sea = sum(res) / len(res)
75 moving_mean = sum(moving_mean) / len(moving_mean)
76 return sea, moving_mean
77
78
79class EncoderLayer(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected