MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / __init__

Method __init__

models/utils.py:11–18  ·  view source on GitHub ↗
(self, num_class, input_dim, hidden_dim, output_dim,
                 num_layers)

Source from the content-addressed store, hash-verified

9
10class GroupwiseMLP(nn.Module):
11 def __init__(self, num_class, input_dim, hidden_dim, output_dim,
12 num_layers):
13 super().__init__()
14 self.num_layers = num_layers
15 h = [hidden_dim] * (num_layers - 1)
16 self.layers = nn.ModuleList(
17 GroupWiseLinear(num_class, n, k)
18 for n, k in zip([input_dim] + h, h + [output_dim]))
19
20 def forward(self, x):
21 if x.dim() == 4:

Callers

nothing calls this directly

Calls 2

GroupWiseLinearClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected