61228f3243eaee39cba31a9abd2afc6ead9612a8,implementations/ccgan/ccgan.py,,,#,51
Before Change
discriminator.apply(weights_init_normal)
// Configure data loader
os.makedirs("../../data/cifar10", exist_ok=True)
cifar_loader = torch.utils.data.DataLoader(
datasets.CIFAR10("../../data/cifar10", train=True, download=True,
transform=transforms.Compose([
transforms.Resize(opt.img_size),
After Change
transforms_ = [ transforms.Resize((opt.img_size, opt.img_size), Image.BICUBIC),
transforms.ToTensor(),
transforms.Normalize((0.5,0.5,0.5), (0.5,0.5,0.5)) ]
transforms_lr = [ transforms.Resize((opt.img_size//4, opt.img_size//4), Image.BICUBIC),
transforms.ToTensor(),
transforms.Normalize((0.5,0.5,0.5), (0.5,0.5,0.5)) ]
dataloader = DataLoader(ImageDataset("../../data/%s" % opt.dataset_name,
transforms_x=transforms_, transforms_lr=transforms_lr),
batch_size=opt.batch_size, shuffle=True, num_workers=opt.n_cpu)
// Optimizers
optimizer_G = torch.optim.Adam(generator.parameters(), lr=opt.lr, betas=(opt.b1, opt.b2))
optimizer_D = torch.optim.Adam(discriminator.parameters(), lr=opt.lr, betas=(opt.b1, opt.b2))
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
Instances
Project Name: eriklindernoren/PyTorch-GAN
Commit Name: 61228f3243eaee39cba31a9abd2afc6ead9612a8
Time: 2018-05-04
Author: eriklindernoren@gmail.com
File Name: implementations/ccgan/ccgan.py
Class Name:
Method Name:
Project Name: kubeflow/kubeflow
Commit Name: 99c94d88c96c2b0a45bbbef4c8a126fa018ce513
Time: 2018-10-11
Author: 37601826+kunmingg@users.noreply.github.com
File Name: bootstrap/build.py
Class Name:
Method Name: main
Project Name: AllenCellModeling/pytorch_fnet
Commit Name: b58d873bc4344117bf8a2b42651e9acb5aeddb4e
Time: 2018-01-22
Author: chek.o@outlook.com
File Name: predict.py
Class Name:
Method Name: main
Project Name: ikostrikov/pytorch-a2c-ppo-acktr
Commit Name: 4586366c1018257dd448d62f1fc7534e3f5a4338
Time: 2017-11-23
Author: ikostrikov@gmail.com
File Name: enjoy.py
Class Name:
Method Name: