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)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
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: inspirehep/magpie
Commit Name: 28b8b9d39f53d8327dbf658048a81b7046ae398f
Time: 2017-10-08
Author: stypka@spotify.com
File Name: magpie/nn/models.py
Class Name:
Method Name: cnn
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: