MCPcopy Create free account
hub / github.com/PABannier/sam3.cpp / __init__

Method __init__

tests/dump_vit_reference.py:111–117  ·  view source on GitHub ↗
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)

Source from the content-addressed store, hash-verified

109except ImportError:
110 class Mlp(nn.Module):
111 def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
112 super().__init__()
113 out_features = out_features or in_features
114 hidden_features = hidden_features or in_features
115 self.fc1 = nn.Linear(in_features, hidden_features)
116 self.act = act_layer()
117 self.fc2 = nn.Linear(hidden_features, out_features)
118 def forward(self, x):
119 return self.fc2(self.act(self.fc1(x)))
120

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected