This adds the option to set a random seed to enable reproducible results from the main sources of randomness: train/test/val masks, augmentations, and dataset shuffling.
The only addition to the model itself was the setter set_random_seed, which takes an integer and uses it as a seed to the RNGs for Python itself (random, used for mask shuffling), Numpy (np.random, used bygraph_extract_patch), and Tensorflow (tf.random, used for dataset shuffling, augmentations, and dropout layers).
Some tests were also added to verify the reproducible nature of each of the main randomness sources. These tests make the assumption that we reproduction matters across different graphs and sessions; a graph & session are made for a model with a seed when a program is run, and then the program is run again, making a new copy of the same graph & session with the same seed.
The test suite w/ additions run and the examples should still run fine.
This adds the option to set a random seed to enable reproducible results from the main sources of randomness: train/test/val masks, augmentations, and dataset shuffling.
The only addition to the model itself was the setter
set_random_seed
, which takes an integer and uses it as a seed to the RNGs for Python itself (random, used for mask shuffling), Numpy (np.random, used bygraph_extract_patch
), and Tensorflow (tf.random, used for dataset shuffling, augmentations, and dropout layers).Some tests were also added to verify the reproducible nature of each of the main randomness sources. These tests make the assumption that we reproduction matters across different graphs and sessions; a graph & session are made for a model with a seed when a program is run, and then the program is run again, making a new copy of the same graph & session with the same seed.
The test suite w/ additions run and the examples should still run fine.