Replies: 3 comments
-
Passing a KeyArray was possible at some point. I do not know why we removed it. However, it should be pretty straightforward implement it in a PR. Please feel encourage to give it a try. In the constructor of EngineBuilder, you want to check the type of the seed argument:
liesel/liesel/goose/builder.py Lines 132 to 133 in 1ee02de |
Beta Was this translation helpful? Give feedback.
-
Hey sure I'll give it a try later. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your contribution! Since the request has since been implemented in #157, I'm closing this thread. |
Beta Was this translation helpful? Give feedback.
-
Hey
liesel
devs. Currently I'm pondering on how to safely use parallel pseudo-random number generation inJAX
for a simulation study. In a simulation study in general it is important to have repeatable pseudo-random numbers across multiple processes (local or distributed) such that the streams are independent. Innumpy
this can be guaranteed (with very very high prob) by spawning. InJAX
we can either usejax.random.split
orjax.random.fold_in
for safe production of (pseudo) independent streams (directly or indirectly via further key derivation). However both involve passing ajax.random.PRNGKey
and not the seed. Creating a iterable/list of integers and iterating over them is not safe, corresponding to the followingSee #18211 and here for some discussions.
In order to reliably produce independent streams within a simulation study, it would be important to have the option of directly passing a
jax.random.PRNGKey
to theEngineBuilder
. This should be quite easy to implement as far as I can see.Beta Was this translation helpful? Give feedback.
All reactions