Ushou Mori
Ushou Mori

Reputation: 23

cannot understand numpy.random.RandomState

I read the source code of Deep Learning by using Python.(Yusuke Sugomori DBN). I could not understand the meaning of numpy_rng = numpy.random.RandomState(1234). when I type:

>>> import numpy
>>> a = numpy.random.RandomState(1234)
>>> a

it shows <mtrand.RandomState object at 0x100412150>

Is is right? What meaning is this? Any idea , thanks!!

Upvotes: 1

Views: 393

Answers (2)

niushencheng
niushencheng

Reputation: 1

You can use like this:

rdm = RandomState(1)
data = rdm.rand(128, 2)

Upvotes: 0

Dan D.
Dan D.

Reputation: 74645

It creates a numpy.random.RandomState object:

RandomState exposes a number of methods for generating random numbers drawn from a variety of probability distributions.

See numpy.random.RandomState for the class parameters and the complete list of methods.

Upvotes: 2

Related Questions