Method
__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
Source from the content-addressed store, hash-verified
| 10 | |
| 11 | class 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
Tested by
no test coverage detected