Merge pull request #1780 from mozilla/set-random-seed

Set graph's random seed when training
This commit is contained in:
Reuben Morais 2018-12-12 10:04:51 -02:00 committed by GitHub
commit f0ba315aeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -890,6 +890,7 @@ def main(_):
if len(FLAGS.worker_hosts) == 0:
# Only one local task: this process (default case - no cluster)
with tf.Graph().as_default():
tf.set_random_seed(FLAGS.random_seed)
train()
# Now do a final test epoch
if FLAGS.test:

View File

@ -111,7 +111,7 @@ def create_flags():
# Initialization
tf.app.flags.DEFINE_integer ('random_seed', 4567, 'default random seed that is used to initialize variables')
tf.app.flags.DEFINE_integer ('random_seed', 4568, 'default random seed that is used to initialize variables')
# Early Stopping