dopamine icon indicating copy to clipboard operation
dopamine copied to clipboard

Does dopamine set a random seed?

Open halleanwoo opened this issue 6 years ago • 8 comments

Does dopamine set a random seed?

halleanwoo avatar Apr 03 '19 13:04 halleanwoo

we don't set one explicitly. is that what you are referring to?

psc-g avatar Apr 03 '19 17:04 psc-g

Thanks for your replay. If I want to compare results of two ideas, should I set a random seed?

halleanwoo avatar Apr 04 '19 01:04 halleanwoo

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

psc-g avatar Apr 05 '19 16:04 psc-g

I see,thanks for your patience. May a nice day

halleanwoo avatar Apr 06 '19 12:04 halleanwoo

@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?

RylanSchaeffer avatar Dec 29 '20 01:12 RylanSchaeffer

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:

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 .

psc-g avatar Jan 06 '21 15:01 psc-g

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

RylanSchaeffer avatar Jan 06 '21 18:01 RylanSchaeffer

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 .

psc-g avatar Jan 06 '21 19:01 psc-g