Merge pull request #1780 from mozilla/set-random-seed
Set graph's random seed when training
This commit is contained in:
commit
f0ba315aeb
|
@ -890,6 +890,7 @@ def main(_):
|
||||||
if len(FLAGS.worker_hosts) == 0:
|
if len(FLAGS.worker_hosts) == 0:
|
||||||
# Only one local task: this process (default case - no cluster)
|
# Only one local task: this process (default case - no cluster)
|
||||||
with tf.Graph().as_default():
|
with tf.Graph().as_default():
|
||||||
|
tf.set_random_seed(FLAGS.random_seed)
|
||||||
train()
|
train()
|
||||||
# Now do a final test epoch
|
# Now do a final test epoch
|
||||||
if FLAGS.test:
|
if FLAGS.test:
|
||||||
|
|
|
@ -111,7 +111,7 @@ def create_flags():
|
||||||
|
|
||||||
# Initialization
|
# 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
|
# Early Stopping
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue