570cd4f66bdf9c3e4b4bb8fbc31fa24b0bd7cdbd,implementations/cgan/cgan.py,Generator,__init__,#Generator#,45

Before Change


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

        cnn_layers = [  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.model = 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
        self.l1 = nn.Sequential(nn.Linear(opt.latent_dim, 128*self.init_size**2))

        self.model = nn.Sequential(
            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: 14

Instances


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


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 61228f3243eaee39cba31a9abd2afc6ead9612a8
Time: 2018-05-04
Author: eriklindernoren@gmail.com
File Name: implementations/pix2pix/models.py
Class Name: GeneratorUNet
Method Name: __init__


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 61228f3243eaee39cba31a9abd2afc6ead9612a8
Time: 2018-05-04
Author: eriklindernoren@gmail.com
File Name: implementations/discogan/models.py
Class Name: GeneratorUNet
Method Name: __init__