Does dopamine set a random seed?
Does dopamine set a random seed?
we don't set one explicitly. is that what you are referring to?
Thanks for your replay. If I want to compare results of two ideas, should I set a random seed?
if you want to compare with the same seed, then yes. otherwise tensorflow will use a different seed each time. but in general it's preferable to do a few independent runs and report mean + confidence intervals
I see,thanks for your patience. May a nice day
@psc-g , what's the proper way to set a seed within Dopamine?
Also, the pretrained JAX agents (https://github.com/google/dopamine/tree/master/dopamine/jax) seem to be 5 different runs, which I assume corresponds to 5 seeds?
hi rylan, you can change the seeds for JAX agents by modifying the parameter to PRNGKey here: https://github.com/google/dopamine/blob/master/dopamine/jax/agents/dqn/dqn_agent.py#L287
unfortunately, this is not the only source of non-determinism. to name two important source:
- there can be non-determinism when training with GPUs (e.g. this article https://www.twosigma.com/articles/a-workaround-for-non-determinism-in-tensorflow/ )
- if you're running with sticky actions, there is a source of randomness there https://github.com/openai/atari-py/blob/5ca24caf395320ead8c77440fe729cf53804616a/atari_py/ale_interface/src/environment/stella_environment.cpp#L155 and there are likely others i'm missing.
hope this helps!
On Mon, Dec 28, 2020 at 8:19 PM Rylan Schaeffer [email protected] wrote:
@psc-g https://github.com/psc-g , what's the proper way to set a seed within Dopamine? The pretrained JAX agents ( https://github.com/google/dopamine/tree/master/dopamine/jax) seem to be 5 different runs, which I assume corresponds to 5 seeds?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/dopamine/issues/96#issuecomment-751913319, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3CCMMXSPE4YUEHOEZDEZTSXEVB3ANCNFSM4HDJ2R2A .
Hi Pablo, sorry I should have clarified - is there a way to change the seeds for TF agents? I guess if there's always stochasticity, this matters less than I thought
you could try this? https://www.tensorflow.org/api_docs/python/tf/compat/v1/set_random_seed caveat: i've never used that function.
On Wed, Jan 6, 2021 at 1:04 PM Rylan Schaeffer [email protected] wrote:
Hi Pablo, sorry I should have clarified - is there a way to change the seeds for TF agents? I guess if there's always stochasticity, this matters less than I thought
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/dopamine/issues/96#issuecomment-755463179, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3CCMIYRCTXU7Q6SDWVBCTSYSQ2DANCNFSM4HDJ2R2A .