MCPcopy Create free account
hub / github.com/Vegetebird/GraphMLP / Mlp

Class Mlp

model/block/mlp_gcn.py:25–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24
25class Mlp(nn.Module):
26 def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
27 super().__init__()
28 out_features = out_features or in_features
29 hidden_features = hidden_features or in_features
30 self.fc1 = nn.Linear(in_features, hidden_features)
31 self.act = act_layer()
32 self.fc2 = nn.Linear(hidden_features, out_features)
33 self.drop = nn.Dropout(drop)
34
35 def forward(self, x):
36 x = self.fc1(x)
37 x = self.act(x)
38 x = self.drop(x)
39 x = self.fc2(x)
40 x = self.drop(x)
41
42 return x
43
44
45class Mlp_ln(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected