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

Class Decoder

layers/Autoformer_EncDec.py:153–173  ·  view source on GitHub ↗

Autoformer encoder

Source from the content-addressed store, hash-verified

151
152
153class Decoder(nn.Module):
154 """
155 Autoformer encoder
156 """
157 def __init__(self, layers, norm_layer=None, projection=None):
158 super(Decoder, self).__init__()
159 self.layers = nn.ModuleList(layers)
160 self.norm = norm_layer
161 self.projection = projection
162
163 def forward(self, x, cross, x_mask=None, cross_mask=None, trend=None):
164 for layer in self.layers:
165 x, residual_trend = layer(x, cross, x_mask=x_mask, cross_mask=cross_mask)
166 trend = trend + residual_trend
167
168 if self.norm is not None:
169 x = self.norm(x)
170
171 if self.projection is not None:
172 x = self.projection(x)
173 return x, trend

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected