a4697d7e45e66a3264eb56dcf489d67d4df40d23,implementations/cgan/cgan.py,Discriminator,__init__,#Discriminator#,74
Before Change
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
self.model = nn.Sequential(*layers)
// The height and width of downsampled image
ds_size = opt.img_size // 2**4
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: 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: dmlc/dgl
Commit Name: 6f4898a128ebc5227e312640508629b50b32571b
Time: 2018-12-02
Author: yma@yma.io
File Name: examples/mxnet/gcn/gcn_batch.py
Class Name: GCN
Method Name: forward
Project Name: dpressel/mead-baseline
Commit Name: 509453992838a524f6442d4e0f07a034390ae1f7
Time: 2020-02-13
Author: dpressel@gmail.com
File Name: layers/eight_mile/tf/layers.py
Class Name: ConvEncoderStack
Method Name: __init__