Replies: 1 comment
-
Good point, that's something I had in mind too since numpy.random introduced generators, I'll add this as a "feature request" issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I really like this package and it's very intuitive to use :) One thing that would make me love it even more would be to allow the user to provide/fix the random state so that results can be exactly reproduced. I am still getting familiar with the abstractions and inner workings of the package, but I was thinking something like this could work:
utils.py
that generates an instance ofnp.random.Generator
given either a seed or another rngrs_doc
,resampling_scheme
,resampling
. Mostly this requires adding an extra argumentrng=None
to the various resampling functions (as well asuniform_spacings
and the queue). E.g.rng=None
to the arguments ofArrayMCMC
and store it as an attribute. ThenArrayMetropolis
,ArrayRandomWalk
etc can use it within thestep()
andproposal
methods respectively. When one instantiates aMCMCSequence
one would pass an optionalrng
. In the same way,rng
is passed down from theFKSMCsampler
, which gets handed it down from e.g.Tempering
orAdaptiveTempering
.The same thing can be done for
FeynmanKac
andSMC
. I tried it on my machine and it seems to work smoothly. One could probably work directly withrng
and the argumentseed
insetup_rng
would be redundant. I find that, depending on what I am trying to do and compare results with, I sometimes need to pass a seed or an rng, so could be an option to leave both.Let me know what you think :)
Beta Was this translation helpful? Give feedback.
All reactions