We should add functionality to set the seed for torch This came up because @VinCheetah is having a bit of trouble replicating results from the 2022 eLife TweetyNet paper A separate question is whether we want to "set the seed for everything", I see some libraries do something like this (from https://gist.github.com/gatheluck/c57e2a40e3122028ceaecc3cb0d152ac) ```python import os import random import numpy as np import torch def set_all_seeds(seed): random.seed(seed) os.environ('PYTHONHASHSEED') = str(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.backends.cudnn.deterministic = True ``` Earlier versions of `lightning` similarly had a function `seed_everything` (that AFAICT has since migrated to `fabric`): https://pytorch-lightning.readthedocs.io/en/1.7.7/api/pytorch_lightning.utilities.seed.html#pytorch_lightning.utilities.seed.seed_everything but just doing a bare minimum of setting the torch seed will let us control e.g. random initialization of model parameters
Activity