From 1a0428a1ec441adbacf9df7cc18a6fccf75b83bc Mon Sep 17 00:00:00 2001 From: Wok Date: Fri, 15 Feb 2019 19:39:25 +0100 Subject: [PATCH] Fix image rescaling to [0,1] --- sgan/sgan.py | 2 +- wgan/wgan.py | 2 +- wgan_gp/wgan_gp.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sgan/sgan.py b/sgan/sgan.py index 21feec8dd7..c42419bb64 100644 --- a/sgan/sgan.py +++ b/sgan/sgan.py @@ -175,7 +175,7 @@ def sample_images(self, epoch): gen_imgs = self.generator.predict(noise) # Rescale images 0 - 1 - gen_imgs = 0.5 * gen_imgs + 1 + gen_imgs = 0.5 * gen_imgs + 0.5 fig, axs = plt.subplots(r, c) cnt = 0 diff --git a/wgan/wgan.py b/wgan/wgan.py index 402f77c717..2ed96ead43 100644 --- a/wgan/wgan.py +++ b/wgan/wgan.py @@ -173,7 +173,7 @@ def sample_images(self, epoch): gen_imgs = self.generator.predict(noise) # Rescale images 0 - 1 - gen_imgs = 0.5 * gen_imgs + 1 + gen_imgs = 0.5 * gen_imgs + 0.5 fig, axs = plt.subplots(r, c) cnt = 0 diff --git a/wgan_gp/wgan_gp.py b/wgan_gp/wgan_gp.py index 350098720a..f7d24e7cac 100644 --- a/wgan_gp/wgan_gp.py +++ b/wgan_gp/wgan_gp.py @@ -227,7 +227,7 @@ def sample_images(self, epoch): gen_imgs = self.generator.predict(noise) # Rescale images 0 - 1 - gen_imgs = 0.5 * gen_imgs + 1 + gen_imgs = 0.5 * gen_imgs + 0.5 fig, axs = plt.subplots(r, c) cnt = 0