Skip to content

Commit 80b471d

Browse files
committed
Fixed scaling for samples generator
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
1 parent 77ed721 commit 80b471d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wgan_gp/wgan_gp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def sample_images(self, epoch):
227227
gen_imgs = self.generator.predict(noise)
228228

229229
# Rescale images 0 - 1
230-
gen_imgs = 0.5 * gen_imgs + 1
230+
gen_imgs = 0.5 * gen_imgs + 0.5
231231

232232
fig, axs = plt.subplots(r, c)
233233
cnt = 0

0 commit comments

Comments
 (0)