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

Method __init__

LDPS_Graph/layers/Autoformer_EncDec.py:135–149  ·  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

133 Autoformer decoder layer with the progressive decomposition architecture
134 """
135 def __init__(self, self_attention, cross_attention, d_model, c_out, d_ff=None,
136 moving_avg=25, dropout=0.1, activation="relu"):
137 super(DecoderLayer, self).__init__()
138 d_ff = d_ff or 4 * d_model
139 self.self_attention = self_attention
140 self.cross_attention = cross_attention
141 self.conv1 = nn.Conv1d(in_channels=d_model, out_channels=d_ff, kernel_size=1, bias=False)
142 self.conv2 = nn.Conv1d(in_channels=d_ff, out_channels=d_model, kernel_size=1, bias=False)
143 self.decomp1 = series_decomp(moving_avg)
144 self.decomp2 = series_decomp(moving_avg)
145 self.decomp3 = series_decomp(moving_avg)
146 self.dropout = nn.Dropout(dropout)
147 self.projection = nn.Conv1d(in_channels=d_model, out_channels=c_out, kernel_size=3, stride=1, padding=1,
148 padding_mode='circular', bias=False)
149 self.activation = F.relu if activation == "relu" else F.gelu
150
151 def forward(self, x, cross, x_mask=None, cross_mask=None):
152 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