Hello,
I encountered inconsistent behaviour for random processes within the generator when using multiprocessing for abcpmc.Sampler(..., postfn = testrand, ... )
`
def testrand():
import random
import numpy as np
random.randrange(1000) # Is random
np.random.randint(1000, size=1) # yields same results for every process
np.random.poisson(1000,10) # yields same results for every process
return 0
`
One possible workaround is to use random to set a random seed for numpy within the function:
seed = random.randrange(4294967295)
np.random.seed(seed=seed)
however this is bulky and might confuse some users that might not know about this behaviour.
Could you please consider adapting abcpmc to also exhibit the random behavior for numpy.random?
Thanks
jakgel
Hello,
I encountered inconsistent behaviour for random processes
withinthe generator when using multiprocessing forabcpmc.Sampler(..., postfn = testrand, ... )`
`
One possible workaround is to use random to set a random seed for numpy within the function:
seed = random.randrange(4294967295)np.random.seed(seed=seed)however this is bulky and might confuse some users that might not know about this behaviour.
Could you please consider adapting abcpmc to also exhibit the random behavior for numpy.random?
Thanks
jakgel