On Feb 22, 2018 16:30, "Kevin Sheppard" <kevin.k.shepp...@gmail.com> wrote:


> What is the syntax to construct an initialized generator?
> RandomGenerator(Xoroshiro128(my_seed))?
>
>
Not 100% certain on this.  There was talk in the earlier thread that seed
should be killed,


No, just the np.random.seed() function alias for the hidden global PRNG.
Core PRNGs should be initializable with a seed number like this, and
instances of these objects should also have a seed() method to reset the
state.

I think all of the core PRNGs MUST be seedable by being given a uint32
integer, at minimum. They MAY be seedable by other inputs (uint64, Python
long, array of ints) depending on the algorithm.

although I wasn't clear what mathod would be
preferrable to get easily reproducible random numbers.

Another option would be

RandomGenerator(Xoroshiro128, seed=my_seed)


I recommend the first option. With things like settable streams, the
diversity of initialization options between algorithms is best implemented
by a diversity of initializers than trying to force everything into one
complicated initializer.

While I think the first option is the best way to implement things, we can
make some syntactic sugar to make things nicer. For example,
`Xoroshiro128(my_seed).generator` where `.generator` is implemented as a
property that returns `RandomGenerator(self)`.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to