(self, num_class, input_dim, hidden_dim, output_dim,
num_layers)
| 9 | |
| 10 | class 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: |
nothing calls this directly
no test coverage detected