-
Hi All, I have a question about applying random transforms. Say I have two composite transforms, one for training images (x values), and one for training masks (y values). Each of these composite transforms contain random transformations (like flipping, zooming, etc.). I need to make sure that any random transforms that are applied to the image are also applied to the mask. Is Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
set_determinism will set the global seed. you can also use The Line 1080 in e223932 |
Beta Was this translation helpful? Give feedback.
set_determinism will set the global seed. you can also use
set_random_state
ofCompose
which is more convenient for your use case.The
ArrayDataset
used in the demo script callstransform.set_random_state(seed=self._seed)
to ensure the transforms are synchronised. At eachgetitem
,self._seed
is refreshedMONAI/monai/data/dataset.py
Line 1080 in e223932