MCPcopy Create free account
hub / github.com/Anoise/WTFlib / Decoder

Class Decoder

LDPS_Graph/layers/Autoformer_EncDec.py:172–192  ·  view source on GitHub ↗

Autoformer encoder

Source from the content-addressed store, hash-verified

170
171
172class Decoder(nn.Module):
173 """
174 Autoformer encoder
175 """
176 def __init__(self, layers, norm_layer=None, projection=None):
177 super(Decoder, self).__init__()
178 self.layers = nn.ModuleList(layers)
179 self.norm = norm_layer
180 self.projection = projection
181
182 def forward(self, x, cross, x_mask=None, cross_mask=None, trend=None):
183 for layer in self.layers:
184 x, residual_trend = layer(x, cross, x_mask=x_mask, cross_mask=cross_mask)
185 trend = trend + residual_trend
186
187 if self.norm is not None:
188 x = self.norm(x)
189
190 if self.projection is not None:
191 x = self.projection(x)
192 return x, trend

Callers 3

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected