MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / __init__

Method __init__

selfpatch_vision_transformer.py:53–60  ·  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

51
52class Mlp(nn.Module):
53 def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
54 super().__init__()
55 out_features = out_features or in_features
56 hidden_features = hidden_features or in_features
57 self.fc1 = nn.Linear(in_features, hidden_features)
58 self.act = act_layer()
59 self.fc2 = nn.Linear(hidden_features, out_features)
60 self.drop = nn.Dropout(drop)
61
62 def forward(self, x):
63 x = self.fc1(x)

Callers 11

__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
__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