e4dedd15f0dd909f48385867b874519e57ea0363,implementations/acgan/acgan.py,Generator,__init__,#Generator#,45

Before Change


        self.init_size = opt.img_size // 4 // Initial size before upsampling
        self.l1 = nn.Sequential(nn.Linear(opt.latent_dim, 128*self.init_size**2))

        cnn_layers = [  nn.BatchNorm2d(128),
                        nn.Upsample(scale_factor=2),
                        nn.Conv2d(128, 128, 3, stride=1, padding=1),
                        nn.BatchNorm2d(128, 0.8),
                        nn.LeakyReLU(0.2, inplace=True),
                        nn.Upsample(scale_factor=2),
                        nn.Conv2d(128, 64, 3, stride=1, padding=1),
                        nn.BatchNorm2d(64, 0.8),
                        nn.LeakyReLU(0.2, inplace=True),
                        nn.Conv2d(64, opt.channels, 3, stride=1, padding=1),
                        nn.Tanh() ]

        self.conv_blocks = nn.Sequential(*cnn_layers)

    def forward(self, noise, labels):
        gen_input = torch.mul(self.label_emb(labels), noise)
        out = self.l1(gen_input)

After Change


        self.init_size = opt.img_size // 4 // Initial size before upsampling
        self.l1 = nn.Sequential(nn.Linear(opt.latent_dim, 128*self.init_size**2))

        self.conv_blocks = nn.Sequential(
            nn.BatchNorm2d(128),
            nn.Upsample(scale_factor=2),
            nn.Conv2d(128, 128, 3, stride=1, padding=1),
            nn.BatchNorm2d(128, 0.8),
            nn.LeakyReLU(0.2, inplace=True),
            nn.Upsample(scale_factor=2),
            nn.Conv2d(128, 64, 3, stride=1, padding=1),
            nn.BatchNorm2d(64, 0.8),
            nn.LeakyReLU(0.2, inplace=True),
            nn.Conv2d(64, opt.channels, 3, stride=1, padding=1),
            nn.Tanh()
        )

    def forward(self, noise, labels):
        gen_input = torch.mul(self.label_emb(labels), noise)
        out = self.l1(gen_input)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 33

Instances


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: e4dedd15f0dd909f48385867b874519e57ea0363
Time: 2018-04-23
Author: eriklindernoren@gmail.com
File Name: implementations/acgan/acgan.py
Class Name: Generator
Method Name: __init__


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: e4dedd15f0dd909f48385867b874519e57ea0363
Time: 2018-04-23
Author: eriklindernoren@gmail.com
File Name: implementations/acgan/acgan.py
Class Name: Generator
Method Name: __init__


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 570cd4f66bdf9c3e4b4bb8fbc31fa24b0bd7cdbd
Time: 2018-04-22
Author: eriklindernoren@live.se
File Name: implementations/sgan/sgan.py
Class Name: Generator
Method Name: __init__


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 570cd4f66bdf9c3e4b4bb8fbc31fa24b0bd7cdbd
Time: 2018-04-22
Author: eriklindernoren@live.se
File Name: implementations/acgan/acgan.py
Class Name: Generator
Method Name: __init__