Skip to content

Determinism

The template always logs the seed utilized in order to guarantee reproducibility.

The user specifies a seed_index value in the configuration train/default.yaml:

seed_index: 1
deterministic: False

This value indexes an array of deterministic but randomly generated seeds, e.g.:

Setting seed 1273642419 from seeds[1]

Hint

This setup allows to easily run the same experiment with different seeds in a reproducible way. It is enough to run a Hydra multi-run over the seed_index.

The following would run the same experiment with five different seeds, which can be analyzed in the logger dashboard:

python src/project/run.py -m train.seed_index=1,2,3,4

Info

The deterministic option deterministic: False controls the use of deterministic algorithms in PyTorch, it is forwarded to the Lightning Trainer.