Created
April 8, 2019 22:36
-
-
Save loretoparisi/ae82859c3d4e0d86b1da84674133933a to your computer and use it in GitHub Desktop.
Python Randomness - Reproducibility isn't a requirement, it's a necessity!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set the seed for hash based operations in python | |
os.environ['PYTHONHASHSEED'] = '0' | |
seed=1234 | |
# set the seed for random number generator | |
rn.seed(seed) | |
# Set the numpy seed | |
np.random.seed(seed) | |
# Set the random seed in tensorflow at graph level | |
tf.random.set_seed(seed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source: Captcha Cracker, https://colab.research.google.com/drive/16y14HuNd8rl_2WhUZMi33SrKZ1XIc5cy#scrollTo=YAUwJF4TdVj4