Skip to content

Commit

Permalink
Fixed scaling for samples generator
Browse files Browse the repository at this point in the history
Tanh output is [-1,1], so if you shrink it by half you have [-0.5,0.5] and then add 1 you have [0.5,1.5] which gives nothing good in my viewer. So to make it [0,1] we need to add 0.5 instead of 1
  • Loading branch information
DaGuT committed Feb 8, 2019
1 parent 77ed721 commit 80b471d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wgan_gp/wgan_gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80b471d

Please sign in to comment.