Project-MONAI / Project-MONAI/MONAI
Fix seeds per default to global state
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.7k
- Forks
- 1.6k
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 20
Description
Without calling set_random_state on the monai.transforms.Compose , my trainings with Pytorch Lightning are not reproducable, since the seed of Randomizable.set_random_state per default is None.
To enable reproducible trainings using lightnings seed_everything, I would recommend to use the singleton RandomState instance of numpy instead of None per default here.
But I am curious to hear if this was an intentional choice for monai.
https://github.com/Lightning-AI/pytorch-lightning/issues/19600
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the default handling for Randomizable.set_random_state in monai/utils/misc.py around line 81, then review how Compose uses it. Check the linked MONAI documentation and PyTorch Lightning seed_everything context to understand the reproducibility expectation. Done means the default behavior is intentional and documented or changed with evidence that the training behavior is reproducible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100