Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.random.RandomState.set_state

RandomState.set_state(state)

Set the internal state of the generator from a tuple.

For use if one has reason to manually (re-)set the internal state of the“Mersenne Twister”[R195] pseudo-random number generating algorithm.

Parameters:

state : tuple(str, ndarray of 624 uints, int, int, float)

Thestate tuple has the following items:

  1. the string ‘MT19937’, specifying the Mersenne Twister algorithm.
  2. a 1-D array of 624 unsigned integerskeys.
  3. an integerpos.
  4. an integerhas_gauss.
  5. a floatcached_gaussian.
Returns:

out : None

Returns ‘None’ on success.

See also

get_state

Notes

set_state andget_state are not needed to work with any of therandom distributions in NumPy. If the internal state is manually altered,the user should know exactly what he/she is doing.

For backwards compatibility, the form (str, array of 624 uints, int) isalso accepted although it is missing some information about the cachedGaussian value:state=('MT19937',keys,pos).

References

[R195](1,2) M. Matsumoto and T. Nishimura, “Mersenne Twister: A623-dimensionally equidistributed uniform pseudorandom numbergenerator,”ACM Trans. on Modeling and Computer Simulation,Vol. 8, No. 1, pp. 3-30, Jan. 1998.

Previous topic

numpy.random.RandomState.seed

Next topic

numpy.random.RandomState.shuffle

  • © Copyright 2008-2009, The Scipy community.
  • Last updated on Jun 10, 2017.
  • Created usingSphinx 1.5.3.

[8]ページ先頭

©2009-2025 Movatter.jp