A single linear layer which does a 1x1 conv
| 115 | |
| 116 | |
| 117 | class NetLinLayer(nn.Module): |
| 118 | """A single linear layer which does a 1x1 conv""" |
| 119 | |
| 120 | def __init__(self, chn_in, chn_out=1, use_dropout=False): |
| 121 | super(NetLinLayer, self).__init__() |
| 122 | layers = [nn.Dropout()] if use_dropout else [] |
| 123 | layers += [nn.Conv2d(chn_in, chn_out, 1, stride=1, padding=0, bias=False)] |
| 124 | self.model = nn.Sequential(*layers) |
| 125 | |
| 126 | |
| 127 | class vgg16(nn.Module): |