[Numpy-discussion] Random number generation and testing across different OS's.

Sebastian Berg sebastian@sipsolutions....
Fri Apr 12 09:56:56 CDT 2013

On Fri, 2013-04-12 at 10:50 -0400, Andrew Nelson wrote:
>     I have written a differential evolution optimiser that i use for
>     curvefitting.  As a genetic optimisation technique it is stochastic and
>     relies heavily on random number generators to do the minimisation.  As part
>     of the module tests I would like to write a cross-platform test that checks
>     if the fitting is being done correctly.
>     I use an instance of numpy.random.RandomState for the generation.  If I use
>     the seed method on a single platform I get the same output, which I could
>     use to write a test.  However, I am unsure of how the seeding and
>     RandomState works across platforms.
>     If I use the same seed on OSX/Windows/Linux, will I get the same stream of
>     random numbers being generated? I need to know if the test I write works
>     across platforms.


yes, you can be certain of that. NumPy does exactly this for its test as



>     regards,
>     Andrew.
> --
> _____________________________________
> Dr. Andrew Nelson
> _____________________________________
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

More information about the NumPy-Discussion mailing list