aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornunzip <np.scarh@gmail.com>2019-03-04 21:38:17 +0000
committernunzip <np.scarh@gmail.com>2019-03-04 21:38:17 +0000
commit6529cc095c57e375f34d69fb6bfb36d058dd2192 (patch)
treea2dd9c3d09b8d8d50ce754c1a65eb6869035d705
parentf00bc97bcb820d30d73fed37eb5c0d5ffddcd9ca (diff)
downloade4-gan-6529cc095c57e375f34d69fb6bfb36d058dd2192.tar.gz
e4-gan-6529cc095c57e375f34d69fb6bfb36d058dd2192.tar.bz2
e4-gan-6529cc095c57e375f34d69fb6bfb36d058dd2192.zip
Improve one sided smoothing
-rwxr-xr-xcgan.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cgan.py b/cgan.py
index 880a8b8..ebdfab2 100755
--- a/cgan.py
+++ b/cgan.py
@@ -142,9 +142,10 @@ class CGAN():
# Train the discriminator
if smooth == True:
d_loss_real = self.discriminator.train_on_batch([imgs, labels], valid*0.9)
+ d_loss_fake = self.discriminator.train_on_batch([gen_imgs, labels], valid*0.1)
else:
d_loss_real = self.discriminator.train_on_batch([imgs, labels], valid)
- d_loss_fake = self.discriminator.train_on_batch([gen_imgs, labels], fake)
+ d_loss_fake = self.discriminator.train_on_batch([gen_imgs, labels], fake)
d_loss = 0.5 * np.add(d_loss_real, d_loss_fake)
# ---------------------