Jupyter Notebook Refactoring Series — Part 1

Original article was published on Artificial Intelligence on Medium

Step 2: Reproducible environment

To prevent an unpleasant situation “I don’t know what you mean, it works on my machine”, make sure that you have a reproducible environment. For Python, you can use conda, virtual environments, or docker containers.

Moreover, your code can have dependencies on the random number generators from different libraries. To get the same results more than once, set the seed value. For example, in Python:

import numpy as np
np.random.seed(seed_value)

import tensorflow as tf
tf.set_random_seed(seed_value)