jeudi 26 novembre 2020

How can I deterministically create a lazy random Numpy array?

Essentially, what I want to do is have some random stream that looks like:

x = np.random.standard_normal(N)

where N is an enormously large number. So, x can't fully exist in memory because it is too large. So, I want to be able to create an object that behaves like a lazily executed Numpy array, but can be deterministically and consistently sliced to return actual Numpy arrays: x[a:b]

Essentially, is there a way to "jump" to a different position in Numpy's RNG?


It seems there is some mention of jumping ahead in the numpy.random documentation but this does not seem like what I am looking for and it only has a very specific large jump size.




Aucun commentaire:

Enregistrer un commentaire