(self, image_nc, pose_nc, ngf, img_f, layers, nonlinearity=nn.LeakyReLU(), use_spect=False)
| 38 | |
| 39 | class ADAINEncoder(nn.Module): |
| 40 | def __init__(self, image_nc, pose_nc, ngf, img_f, layers, nonlinearity=nn.LeakyReLU(), use_spect=False): |
| 41 | super(ADAINEncoder, self).__init__() |
| 42 | self.layers = layers |
| 43 | self.input_layer = nn.Conv2d(image_nc, ngf, kernel_size=7, stride=1, padding=3) |
| 44 | for i in range(layers): |
| 45 | in_channels = min(ngf * (2 ** i), img_f) |
| 46 | out_channels = min(ngf * (2 ** (i + 1)), img_f) |
| 47 | model = ADAINEncoderBlock(in_channels, out_channels, pose_nc, nonlinearity, use_spect) |
| 48 | setattr(self, 'encoder' + str(i), model) |
| 49 | self.output_nc = out_channels |
| 50 | |
| 51 | def forward(self, x, z): |
| 52 | out = self.input_layer(x) |
nothing calls this directly
no test coverage detected