570cd4f66bdf9c3e4b4bb8fbc31fa24b0bd7cdbd,implementations/gan/gan.py,Generator,__init__,#Generator#,44

Before Change


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

        layers = [  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() ]

        self.model = nn.Sequential(*layers)

    def forward(self, noise):

After 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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 570cd4f66bdf9c3e4b4bb8fbc31fa24b0bd7cdbd
Time: 2018-04-22
Author: eriklindernoren@live.se
File Name: implementations/gan/gan.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/wgan/wgan.py
Class Name: Generator
Method Name: __init__


Project Name: mozilla/TTS
Commit Name: e82d31b6ac03f20119495559ea09a5a4ed9d7f7e
Time: 2021-01-06
Author: erogol@hotmail.com
File Name: TTS/tts/layers/glow_tts/encoder.py
Class Name: Encoder
Method Name: __init__