(self, image_nc, feature_nc, ngf, img_f, layers, num_block, norm_layer=nn.BatchNorm2d,
nonlinearity=nn.LeakyReLU(), use_spect=False)
| 219 | """docstring for FineDecoder""" |
| 220 | |
| 221 | def __init__(self, image_nc, feature_nc, ngf, img_f, layers, num_block, norm_layer=nn.BatchNorm2d, |
| 222 | nonlinearity=nn.LeakyReLU(), use_spect=False): |
| 223 | super(FineDecoder, self).__init__() |
| 224 | self.layers = layers |
| 225 | for i in range(layers)[::-1]: |
| 226 | in_channels = min(ngf * (2 ** (i + 1)), img_f) |
| 227 | out_channels = min(ngf * (2 ** i), img_f) |
| 228 | up = UpBlock2d(in_channels, out_channels, norm_layer, nonlinearity, use_spect) |
| 229 | res = FineADAINResBlocks(num_block, in_channels, feature_nc, norm_layer, nonlinearity, use_spect) |
| 230 | jump = Jump(out_channels, norm_layer, nonlinearity, use_spect) |
| 231 | |
| 232 | setattr(self, 'up' + str(i), up) |
| 233 | setattr(self, 'res' + str(i), res) |
| 234 | setattr(self, 'jump' + str(i), jump) |
| 235 | |
| 236 | self.final = FinalBlock2d(out_channels, image_nc, use_spect, 'tanh') |
| 237 | |
| 238 | self.output_nc = out_channels |
| 239 | |
| 240 | def forward(self, x, z): |
| 241 | out = x.pop() |
nothing calls this directly
no test coverage detected