MCPcopy Create free account
hub / github.com/ChunmingHe/WS-SAM / __init__

Method __init__

lib/VIT/decoder/decoder_p.py:156–161  ·  view source on GitHub ↗
(self, mode='dilation',dim=128, num_heads=8, ffn_expansion_factor=4, bias=False, LayerNorm_type='WithBias')

Source from the content-addressed store, hash-verified

154
155class MSA_head(nn.Module):
156 def __init__(self, mode='dilation',dim=128, num_heads=8, ffn_expansion_factor=4, bias=False, LayerNorm_type='WithBias'):
157 super(MSA_head, self).__init__()
158 self.norm1 = LayerNorm(dim, LayerNorm_type)
159 self.attn = Attention(dim, num_heads, bias,mode)
160 self.norm2 = LayerNorm(dim, LayerNorm_type)
161 self.ffn = FeedForward(dim, ffn_expansion_factor, bias)
162
163 def forward(self, x,mask=None):
164 x = x + self.attn(self.norm1(x),mask)

Callers

nothing calls this directly

Calls 4

LayerNormClass · 0.85
FeedForwardClass · 0.85
AttentionClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected