MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / __init__

Method __init__

semantic_sam/body/decoder/modules.py:72–83  ·  view source on GitHub ↗
(self, d_model, nhead, dropout=0.0,
                 activation="relu", normalize_before=False)

Source from the content-addressed store, hash-verified

70class CrossAttentionLayer(nn.Module):
71
72 def __init__(self, d_model, nhead, dropout=0.0,
73 activation="relu", normalize_before=False):
74 super().__init__()
75 self.multihead_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)
76
77 self.norm = nn.LayerNorm(d_model)
78 self.dropout = nn.Dropout(dropout)
79
80 self.activation = _get_activation_fn(activation)
81 self.normalize_before = normalize_before
82
83 self._reset_parameters()
84
85 def _reset_parameters(self):
86 for p in self.parameters():

Callers

nothing calls this directly

Calls 3

_reset_parametersMethod · 0.95
_get_activation_fnFunction · 0.70
__init__Method · 0.45

Tested by

no test coverage detected