Skip to content

Commit 5c6ece8

Browse files
authored
Merge pull request #47 from openai/tfseed
added TF seed to both tutorials for reproducibility
2 parents b1169ac + 717e672 commit 5c6ece8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tutorials/mnist_tutorial.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ def main(argv=None):
2727
MNIST cleverhans tutorial
2828
:return:
2929
"""
30+
31+
# Set TF random seed to improve reproducibility
32+
tf.set_random_seed(1234)
33+
3034
# Image dimensions ordering should follow the Theano convention
3135
if keras.backend.image_dim_ordering() != 'th':
3236
keras.backend.set_image_dim_ordering('th')

tutorials/mnist_tutorial_jsma.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def main(argv=None):
3737
:return:
3838
"""
3939

40+
# Set TF random seed to improve reproducibility
41+
tf.set_random_seed(1234)
42+
4043
###########################################################################
4144
# Define the dataset and model
4245
###########################################################################

0 commit comments

Comments
 (0)