From 02d2fca6c53311d87f2f64831ed8470b8ddc06ac Mon Sep 17 00:00:00 2001 From: "Alex J. Champandard" Date: Mon, 31 Oct 2016 20:55:11 +0100 Subject: [PATCH] Corrected value for adversarial loss. Don't refactor math the day after stopping coffee. --- README.rst | 2 +- enhance.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index ffa3331..a4948f8 100644 --- a/README.rst +++ b/README.rst @@ -64,7 +64,7 @@ Pre-trained models are provided in the GitHub releases. Training your own is a # Train the model using an adversarial setup based on [4] below. python3.4 enhance.py --train "data/*.jpg" --model custom --scales=2 --epochs=250 \ - --perceptual-layer=conv5_2 --smoothness-weight=2e4 --adversary-weight=2e5 \ + --perceptual-layer=conv5_2 --smoothness-weight=2e4 --adversary-weight=1e3 \ --generator-start=5 --discriminator-start=0 --adversarial-start=5 \ --discriminator-size=64 diff --git a/enhance.py b/enhance.py index cb67e17..c4fd9fb 100755 --- a/enhance.py +++ b/enhance.py @@ -374,7 +374,7 @@ class Model(object): return T.mean(((x[:,:,:-1,:-1] - x[:,:,1:,:-1])**2 + (x[:,:,:-1,:-1] - x[:,:,:-1,1:])**2)**1.25) def loss_adversarial(self, d): - return T.mean(1.0 - T.nnet.softplus(d[args.batch_size:])) + return T.mean(1.0 - T.nnet.softminus(d[args.batch_size:])) def loss_discriminator(self, d): return T.mean(T.nnet.softminus(d[args.batch_size:]) - T.nnet.softplus(d[:args.batch_size]))