diff --git a/tutorials/mnist_tutorial.py b/tutorials/mnist_tutorial.py index 5f61fb4d9..420948e4d 100644 --- a/tutorials/mnist_tutorial.py +++ b/tutorials/mnist_tutorial.py @@ -27,6 +27,10 @@ def main(argv=None): MNIST cleverhans tutorial :return: """ + + # Set TF random seed to improve reproducibility + tf.set_random_seed(1234) + # Image dimensions ordering should follow the Theano convention if keras.backend.image_dim_ordering() != 'th': keras.backend.set_image_dim_ordering('th') diff --git a/tutorials/mnist_tutorial_jsma.py b/tutorials/mnist_tutorial_jsma.py index 60ab8e7d6..440c85398 100644 --- a/tutorials/mnist_tutorial_jsma.py +++ b/tutorials/mnist_tutorial_jsma.py @@ -37,6 +37,9 @@ def main(argv=None): :return: """ + # Set TF random seed to improve reproducibility + tf.set_random_seed(1234) + ########################################################################### # Define the dataset and model ###########################################################################