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

Method __init__

semantic_sam/backbone/swin.py:29–38  ·  view source on GitHub ↗
(
        self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0
    )

Source from the content-addressed store, hash-verified

27 """Multilayer perceptron."""
28
29 def __init__(
30 self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.0
31 ):
32 super().__init__()
33 out_features = out_features or in_features
34 hidden_features = hidden_features or in_features
35 self.fc1 = nn.Linear(in_features, hidden_features)
36 self.act = act_layer()
37 self.fc2 = nn.Linear(hidden_features, out_features)
38 self.drop = nn.Dropout(drop)
39
40 def forward(self, x):
41 x = self.fc1(x)

Callers 7

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected