(in_features, out_features, is_nonlinear=False)
| 196 | |
| 197 | |
| 198 | def Classifier(in_features, out_features, is_nonlinear=False): |
| 199 | if is_nonlinear: |
| 200 | return torch.nn.Sequential( |
| 201 | torch.nn.Linear(in_features, in_features // 2), |
| 202 | torch.nn.ReLU(), |
| 203 | torch.nn.Linear(in_features // 2, in_features // 4), |
| 204 | torch.nn.ReLU(), |
| 205 | torch.nn.Linear(in_features // 4, out_features)) |
| 206 | else: |
| 207 | return torch.nn.Linear(in_features, out_features) |
| 208 | |
| 209 | |
| 210 | class WholeFish(nn.Module): |