MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / Decoder

Class Decoder

layers/Autoformer_EncDec.py:220–240  ·  view source on GitHub ↗

Autoformer encoder

Source from the content-addressed store, hash-verified

218
219
220class Decoder(nn.Module):
221 """
222 Autoformer encoder
223 """
224 def __init__(self, layers, norm_layer=None, projection=None):
225 super(Decoder, self).__init__()
226 self.layers = nn.ModuleList(layers)
227 self.norm = norm_layer
228 self.projection = projection
229
230 def forward(self, x, cross, x_mask=None, cross_mask=None, trend=None):
231 for layer in self.layers:
232 x, residual_trend = layer(x, cross, x_mask=x_mask, cross_mask=cross_mask)
233 trend = trend + residual_trend
234
235 if self.norm is not None:
236 x = self.norm(x)
237
238 if self.projection is not None:
239 x = self.projection(x)
240 return x, trend

Callers 4

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected