Shortcuts

seed

Functions

seed_everything

Function that sets seed for pseudo-random number generators in: pytorch, numpy, python.random In addition, sets the env variable PL_GLOBAL_SEED which will be passed to spawned subprocesses (e.g.

Helper functions to help with reproducibility of models.

pytorch_lightning.utilities.seed.seed_everything(seed=None)[source]

Function that sets seed for pseudo-random number generators in: pytorch, numpy, python.random In addition, sets the env variable PL_GLOBAL_SEED which will be passed to spawned subprocesses (e.g. ddp_spawn backend).

Parameters

seed (Optional[int]) – the integer value seed for global random state in Lightning. If None, will read seed from PL_GLOBAL_SEED env variable or select it randomly.

Return type

int