Re: [Numpy-discussion] Prototype CorePRNG implementation feedback (Neal Becker)
![](https://secure.gravatar.com/avatar/17dd492efaacbd3728c6a4325db77e63.jpg?s=120&d=mm&r=g)
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, 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) Kevin
![](https://secure.gravatar.com/avatar/764323a14e554c97ab74177e0bce51d4.jpg?s=120&d=mm&r=g)
On Feb 22, 2018 16:30, "Kevin Sheppard" <kevin.k.sheppard@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)`.
![](https://secure.gravatar.com/avatar/764323a14e554c97ab74177e0bce51d4.jpg?s=120&d=mm&r=g)
On Feb 22, 2018 16:30, "Kevin Sheppard" <kevin.k.sheppard@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)`.
participants (2)
-
Kevin Sheppard
-
Robert Kern