MCPcopy Create free account
hub / github.com/kwuking/TimeMixer / __init__

Method __init__

layers/Autoformer_EncDec.py:84–93  ·  view source on GitHub ↗
(self, attention, d_model, d_ff=None, moving_avg=25, dropout=0.1, activation="relu")

Source from the content-addressed store, hash-verified

82 """
83
84 def __init__(self, attention, d_model, d_ff=None, moving_avg=25, dropout=0.1, activation="relu"):
85 super(EncoderLayer, self).__init__()
86 d_ff = d_ff or 4 * d_model
87 self.attention = attention
88 self.conv1 = nn.Conv1d(in_channels=d_model, out_channels=d_ff, kernel_size=1, bias=False)
89 self.conv2 = nn.Conv1d(in_channels=d_ff, out_channels=d_model, kernel_size=1, bias=False)
90 self.decomp1 = series_decomp(moving_avg)
91 self.decomp2 = series_decomp(moving_avg)
92 self.dropout = nn.Dropout(dropout)
93 self.activation = F.relu if activation == "relu" else F.gelu
94
95 def forward(self, x, attn_mask=None):
96 new_x, attn = self.attention(

Callers

nothing calls this directly

Calls 2

series_decompClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected