Exemple #1
0
 def __init__(self, in_channels):
     super().__init__()
     self.mnBtchStdDv = layers.MinibatchStdDev()
     self.conv0 = layers._equalized_conv2d(in_channels + 1, in_channels,
                                           (1, 1))
     self.conv1 = layers._equalized_conv2d(in_channels,
                                           in_channels, (3, 3),
                                           padding=(1, 1))
     self.conv2 = layers._equalized_conv2d(in_channels, 1, (1, 1))
     self.lrelu = nn.LeakyReLU(0.2)
Exemple #2
0
 def __init__(self, in_channels, out_channels, scale_factor):
     super().__init__()
     self.downsampling = nn.MaxPool2d(scale_factor)
     self.conv1 = layers._equalized_deconv2d(1, in_channels, (1, 1))
     self.conv2 = layers._equalized_conv2d(in_channels,
                                           in_channels, (3, 3),
                                           padding=(1, 1))
     self.conv3 = layers._equalized_conv2d(in_channels, out_channels,
                                           (1, 1))
     self.lrelu = nn.LeakyReLU(0.2)
Exemple #3
0
 def __init__(self, in_channels, out_channels, scale_factor):
     super().__init__()
     self.upsampling = nn.UpsamplingNearest2d(scale_factor=scale_factor)
     self.conv1 = layers._equalized_conv2d(in_channels,
                                           out_channels, (3, 3),
                                           padding=(1, 1))
     self.conv2 = layers._equalized_conv2d(out_channels,
                                           out_channels, (3, 3),
                                           padding=(1, 1))
     self.pixNorm = layers.PixelwiseNorm()
     self.lrelu = nn.LeakyReLU(0.2)
Exemple #4
0
    def __init__(self, **kwargs):
        super().__init__()
        self.initBlock = InitGenConvBlock(512, 256)
        self.block1 = UpsamplingConvBlock(256, 256, 2)
        self.block2 = UpsamplingConvBlock(256, 128, 1)
        self.block3 = UpsamplingConvBlock(128, 128, 1)
        self.block4 = UpsamplingConvBlock(128, 64, 1)
        self.block5 = UpsamplingConvBlock(64, 64, 2)
        self.block6 = UpsamplingConvBlock(64, 32, 1)
        self.block7 = UpsamplingConvBlock(32, 32, 1)
        self.block8 = UpsamplingConvBlock(32, 16, 1)

        self.initOut = layers._equalized_conv2d(256, 1, (1, 1), bias=True)
        self.block4Out = layers._equalized_conv2d(128, 1, (1, 1), bias=True)
        self.block8Out = layers._equalized_conv2d(16, 1, (1, 1), bias=True)