You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closing previous issue because the topic has changed, and opening this one instead. Pasting in Nicolas' comments to get this started.
This is an issue warranting special attention, especially as new processing stages get cascaded and the user interacts with deep isetbio components via high levels scripts.
I think that the default behavior should a fixed seed (as Brian suggests), and that any ISETbio component that changes the rng state should save its current state before starting computation, and once finished it should restore that initial state (as David suggests). This should be done consistently with all components that modify the rng state, suggesting that maybe we need a centralized function that manages therng state and that all ISETbio components interact with Matlab's rng, via this function only.
Moreover, the proposed centralized function should get passed the rseed argument that the ISETbio component received, and only accept it if belongs to a set of valid arguments. This will enforce consistent usage of the rSeed argument across the entire stack.
The text was updated successfully, but these errors were encountered:
My view is that our goal here is to minimize the chance that someone gets surprised by what a function does. I think it will be surprising if functions monkey with the rng by default. That is, a user who sets the rng in some mode (frozen seed, 'shuffle', whatever) at the top level will expect that this setting will propagate through all the calculations. Routines that override however the rng was set will cause confusion, even more so if they don't set it back.
So I think that by default no routine should do anything to the rng seed. We tore our hair out over this sort of thing at one point with the Poisson rng and I think finally managed to get all of the resetting out.
I think it is OK for the default behavior to be overridable, as then the user has to do something active and shouldn't be surprised. This can still cause trouble, depending on how the rng seed is passed around. but I can see how one would like to be able to freeze the em trace while not freezing other stuff.
Closing previous issue because the topic has changed, and opening this one instead. Pasting in Nicolas' comments to get this started.
This is an issue warranting special attention, especially as new processing stages get cascaded and the user interacts with deep isetbio components via high levels scripts.
I think that the default behavior should a fixed seed (as Brian suggests), and that any ISETbio component that changes the rng state should save its current state before starting computation, and once finished it should restore that initial state (as David suggests). This should be done consistently with all components that modify the rng state, suggesting that maybe we need a centralized function that manages therng state and that all ISETbio components interact with Matlab's rng, via this function only.
Moreover, the proposed centralized function should get passed the rseed argument that the ISETbio component received, and only accept it if belongs to a set of valid arguments. This will enforce consistent usage of the rSeed argument across the entire stack.
The text was updated successfully, but these errors were encountered: