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

Method __init__

LDPS_Graph/layers/PatchTST_backbone.py:182–191  ·  view source on GitHub ↗
(self, q_len, d_model, n_heads, d_k=None, d_v=None, d_ff=None, 
                        norm='BatchNorm', attn_dropout=0., dropout=0., activation='gelu',
                        res_attention=False, n_layers=1, pre_norm=False, store_attn=False)

Source from the content-addressed store, hash-verified

180# Cell
181class TSTEncoder(nn.Module):
182 def __init__(self, q_len, d_model, n_heads, d_k=None, d_v=None, d_ff=None,
183 norm='BatchNorm', attn_dropout=0., dropout=0., activation='gelu',
184 res_attention=False, n_layers=1, pre_norm=False, store_attn=False):
185 super().__init__()
186
187 self.layers = nn.ModuleList([TSTEncoderLayer(q_len, d_model, n_heads=n_heads, d_k=d_k, d_v=d_v, d_ff=d_ff, norm=norm,
188 attn_dropout=attn_dropout, dropout=dropout,
189 activation=activation, res_attention=res_attention,
190 pre_norm=pre_norm, store_attn=store_attn) for i in range(n_layers)])
191 self.res_attention = res_attention
192
193 def forward(self, src:Tensor,
194 edge_index: torch.LongTensor,

Callers

nothing calls this directly

Calls 2

TSTEncoderLayerClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected