Corrected value for adversarial loss. Don't refactor math the day after stopping coffee.

main
Alex J. Champandard 9 years ago
parent 0c9937a317
commit 02d2fca6c5

@ -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

@ -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]))

Loading…
Cancel
Save