[Numpy-discussion] Random number generation and testing across different OS's.
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
> Dr. Andrew Nelson
> NumPy-Discussion mailing list
More information about the NumPy-Discussion