MCPcopy Create free account
hub / github.com/ZhengPeng7/BiRefNet / __init__

Method __init__

models/modules/mlp.py:12–19  ·  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

10
11class MLPLayer(nn.Module):
12 def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
13 super().__init__()
14 out_features = out_features or in_features
15 hidden_features = hidden_features or in_features
16 self.fc1 = nn.Linear(in_features, hidden_features)
17 self.act = act_layer()
18 self.fc2 = nn.Linear(hidden_features, out_features)
19 self.drop = nn.Dropout(drop)
20
21 def forward(self, x):
22 x = self.fc1(x)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected