From bd8613acf896e3eefaa22dd0c0dc07018821bb03 Mon Sep 17 00:00:00 2001 From: wangyang59 Date: Mon, 31 Oct 2016 15:41:00 -0700 Subject: [PATCH] changed initialization method for demo/gan --- demo/gan/gan_conf_image.py | 8 +++++--- demo/gan/gan_trainer_image.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/demo/gan/gan_conf_image.py b/demo/gan/gan_conf_image.py index defeccb7eb5..58bed2b1894 100644 --- a/demo/gan/gan_conf_image.py +++ b/demo/gan/gan_conf_image.py @@ -117,10 +117,12 @@ def generator(noise): """ generator generates a sample given noise """ - param_attr = ParamAttr(is_static=is_discriminator_training) + param_attr = ParamAttr(is_static=is_discriminator_training, + initial_mean=0.0, + initial_std=0.02) bias_attr = ParamAttr(is_static=is_discriminator_training, - initial_mean=1.0, - initial_std=0) + initial_mean=0.0, + initial_std=0.0) param_attr_bn=ParamAttr(is_static=is_discriminator_training, initial_mean=1.0, diff --git a/demo/gan/gan_trainer_image.py b/demo/gan/gan_trainer_image.py index f6c3d2891b0..536abab9210 100644 --- a/demo/gan/gan_trainer_image.py +++ b/demo/gan/gan_trainer_image.py @@ -197,7 +197,7 @@ def main(): curr_train = "dis" curr_strike = 0 - MAX_strike = 100 + MAX_strike = 10 for train_pass in xrange(100): dis_trainer.startTrainPass() -- GitLab