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

Method __init__

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

Source from the content-addressed store, hash-verified

132class FFNLayer(nn.Module):
133
134 def __init__(self, d_model, dim_feedforward=2048, dropout=0.0,
135 activation="relu", normalize_before=False):
136 super().__init__()
137 # Implementation of Feedforward model
138 self.linear1 = nn.Linear(d_model, dim_feedforward)
139 self.dropout = nn.Dropout(dropout)
140 self.linear2 = nn.Linear(dim_feedforward, d_model)
141
142 self.norm = nn.LayerNorm(d_model)
143
144 self.activation = _get_activation_fn(activation)
145 self.normalize_before = normalize_before
146
147 self._reset_parameters()
148
149 def _reset_parameters(self):
150 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