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

Read the Docs v: stable
Versions
latest
stable
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.10.0
0.9.0
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.0
0.5.3.2
0.5.3
0.4.9
release-1.0.x
Downloads
pdf
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.