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

Method __init__

layers/Autoformer_EncDec.py:116–130  ·  view source on GitHub ↗
(self, self_attention, cross_attention, d_model, c_out, d_ff=None,
                 moving_avg=25, dropout=0.1, activation="relu")

Source from the content-addressed store, hash-verified

114 Autoformer decoder layer with the progressive decomposition architecture
115 """
116 def __init__(self, self_attention, cross_attention, d_model, c_out, d_ff=None,
117 moving_avg=25, dropout=0.1, activation="relu"):
118 super(DecoderLayer, self).__init__()
119 d_ff = d_ff or 4 * d_model
120 self.self_attention = self_attention
121 self.cross_attention = cross_attention
122 self.conv1 = nn.Conv1d(in_channels=d_model, out_channels=d_ff, kernel_size=1, bias=False)
123 self.conv2 = nn.Conv1d(in_channels=d_ff, out_channels=d_model, kernel_size=1, bias=False)
124 self.decomp1 = series_decomp(moving_avg)
125 self.decomp2 = series_decomp(moving_avg)
126 self.decomp3 = series_decomp(moving_avg)
127 self.dropout = nn.Dropout(dropout)
128 self.projection = nn.Conv1d(in_channels=d_model, out_channels=c_out, kernel_size=3, stride=1, padding=1,
129 padding_mode='circular', bias=False)
130 self.activation = F.relu if activation == "relu" else F.gelu
131
132 def forward(self, x, cross, x_mask=None, cross_mask=None):
133 x = x + self.dropout(self.self_attention(

Callers

nothing calls this directly

Calls 2

series_decompClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected