| 21 | |
| 22 | |
| 23 | class LinLayers(nn.ModuleList): |
| 24 | def __init__(self, n_channels_list: Sequence[int]): |
| 25 | super(LinLayers, self).__init__([ |
| 26 | nn.Sequential( |
| 27 | nn.Identity(), |
| 28 | nn.Conv2d(nc, 1, 1, 1, 0, bias=False) |
| 29 | ) for nc in n_channels_list |
| 30 | ]) |
| 31 | |
| 32 | for param in self.parameters(): |
| 33 | param.requires_grad = False |
| 34 | |
| 35 | |
| 36 | class BaseNet(nn.Module): |