Seed documentation

This commit is contained in:
Brandon Rozek 2020-03-20 19:38:35 -04:00
parent 1cad98fcf9
commit a47f3f6037

View file

@ -4,6 +4,14 @@ import random
import torch import torch
def set_seed(SEED): def set_seed(SEED):
"""
Set the seed for repeatability purposes.
Parameters
----------
SEED : int
The seed to set numpy, random, and torch to.
"""
# Set `PYTHONHASHSEED` environment variable at a fixed value # Set `PYTHONHASHSEED` environment variable at a fixed value
environ['PYTHONHASHSEED'] = str(SEED) environ['PYTHONHASHSEED'] = str(SEED)