9e3ac57d2a0480ded339841dda18b13e2645987f,implementations/wgan/wgan.py,Generator,__init__,#Generator#,45

Before Change


    def __init__(self):
        super(Generator, self).__init__()

        self.model = nn.Sequential(
            nn.Linear(opt.latent_dim, 128),
            nn.LeakyReLU(0.2, inplace=True),
            nn.Linear(128, 256),
            nn.BatchNorm1d(256),
            nn.LeakyReLU(0.2, inplace=True),
            nn.Linear(256, 512),
            nn.BatchNorm1d(512),
            nn.LeakyReLU(0.2, inplace=True),
            nn.Linear(512, 1024),
            nn.BatchNorm1d(1024),
            nn.LeakyReLU(0.2, inplace=True),
            nn.Linear(1024, opt.img_size**2),
            nn.Tanh()
        )

    def forward(self, noise):
        img = self.model(noise)
        img = img.view(img.shape[0], opt.channels, opt.img_size, opt.img_size)

After Change


            layers.append(nn.LeakyReLU(0.2, inplace=True))
            return layers

        self.model = nn.Sequential(
            *block(opt.latent_dim, 128, normalize=False),
            *block(128, 256),
            *block(256, 512),
            *block(512, 1024),
            nn.Linear(1024, int(np.prod(img_shape))),
            nn.Tanh()
        )

    def forward(self, z):
        img = self.model(z)
        img = img.view(img.shape[0], *img_shape)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 42

Instances


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 9e3ac57d2a0480ded339841dda18b13e2645987f
Time: 2018-05-12
Author: eriklindernoren@gmail.com
File Name: implementations/wgan/wgan.py
Class Name: Generator
Method Name: __init__


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 9e3ac57d2a0480ded339841dda18b13e2645987f
Time: 2018-05-12
Author: eriklindernoren@gmail.com
File Name: implementations/softmax_gan/softmax_gan.py
Class Name: Generator
Method Name: __init__


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 9e3ac57d2a0480ded339841dda18b13e2645987f
Time: 2018-05-12
Author: eriklindernoren@gmail.com
File Name: implementations/bgan/bgan.py
Class Name: Generator
Method Name: __init__


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 9e3ac57d2a0480ded339841dda18b13e2645987f
Time: 2018-05-12
Author: eriklindernoren@gmail.com
File Name: implementations/wgan/wgan.py
Class Name: Generator
Method Name: __init__


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 9e3ac57d2a0480ded339841dda18b13e2645987f
Time: 2018-05-12
Author: eriklindernoren@gmail.com
File Name: implementations/wgan_gp/wgan_gp.py
Class Name: Generator
Method Name: __init__