[Numpy-discussion] SFMT (faster mersenne twister)

Julian Taylor jtaylor.debian at googlemail.com
Mon Sep 8 14:00:27 EDT 2014


On 08.09.2014 19:05, Pierre-Andre Noel wrote:
>  > I think we could add new generators to NumPy though,
>  > perhaps with a keyword to control the algorithm (defaulting to the 
> current
>  > Mersenne Twister).
> 
...
> 
> Here is how I propose to adapt this scheme to numpy. First, there would 
> be a global generator defaulting to the current implementation of 
> Mersene Twister. Calls to numpy's "RandomState", "seed", "get_state" and 
> "set_state" would affect this global generator.
> 
> All numpy functions associated to random number generation (i.e., 
> everything listed on 
> http://docs.scipy.org/doc/numpy/reference/routines.random.html except 
> for "RandomState", "seed", "get_state" and "set_state") would accept the 
> kwarg "generator", which defaults to the global generator (by default 
> the current Mersene Twister).
> 


I don't think every function would need a generator argument, for real
world applications it should be sufficient to have the state object
carry which generator is used and maybe a switch to change the global one.

But as already mentioned by Robert, we know what we can do, what is
missing is someone writting the code.




More information about the NumPy-Discussion mailing list