de-normalize images for displaying

sorry, the previous pull request  inserting real_cpu in the wrong place
This commit is contained in:
Xinwei He 2017-04-01 09:52:08 +08:00 committed by GitHub
parent e05cae9275
commit 8ab2d26efe
1 changed files with 2 additions and 0 deletions

View File

@ -218,8 +218,10 @@ for epoch in range(opt.niter):
% (epoch, opt.niter, i, len(dataloader), gen_iterations,
errD.data[0], errG.data[0], errD_real.data[0], errD_fake.data[0]))
if gen_iterations % 500 == 0:
real_cpu = real_cpu.mul(0.5).add(0.5)
vutils.save_image(real_cpu, '{0}/real_samples.png'.format(opt.experiment))
fake = netG(Variable(fixed_noise, volatile=True))
fake.data = fake.data.mul(0.5).add(0.5)
vutils.save_image(fake.data, '{0}/fake_samples_{1}.png'.format(opt.experiment, gen_iterations))
# do checkpointing