a4697d7e45e66a3264eb56dcf489d67d4df40d23,implementations/cgan/cgan.py,Discriminator,__init__,#Discriminator#,74

Before Change


                block.append(nn.BatchNorm2d(out_filters, 0.8))
            return block

        layers = []
        in_filters = opt.channels + 1
        for out_filters, bn in [(16, False), (32, True), (64, True), (128, False)]:
            layers.extend(discriminator_block(in_filters, out_filters, bn))
            in_filters = out_filters

After Change



        self.label_embedding = nn.Embedding(opt.n_classes, opt.n_classes)

        self.model = nn.Sequential(
            nn.Linear(opt.n_classes + opt.img_size**2, 512),
            nn.LeakyReLU(0.2, inplace=True),
            nn.Linear(512, 512),
            nn.Dropout(0.4),
            nn.LeakyReLU(0.2, inplace=True),
            nn.Linear(512, 512),
            nn.Dropout(0.4),
            nn.LeakyReLU(0.2, inplace=True),
            nn.Linear(512, 1),
            nn.Sigmoid()
        )

    def forward(self, img, labels):
        // Concatenate label embedding and image by channels
        d_input = torch.cat((img.view(img.size(0), -1), self.label_embedding(labels)), -1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


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


Project Name: philipperemy/keras-tcn
Commit Name: 0cfe82c6beb9a28a5ff7da81b86fa0e93c388f14
Time: 2019-11-20
Author: premy@cogent.co.jp
File Name: tasks/save_reload_model.py
Class Name:
Method Name:


Project Name: dpressel/mead-baseline
Commit Name: 509453992838a524f6442d4e0f07a034390ae1f7
Time: 2020-02-13
Author: dpressel@gmail.com
File Name: layers/eight_mile/pytorch/layers.py
Class Name: ConvEncoderStack
Method Name: __init__