Skip to content

Add jumpy.random.Generator #27

@pseudo-rnd-thoughts

Description

@pseudo-rnd-thoughts

Jumpy's random functions are a bit weird for numpy as it uses a np.array as the key but needs to convert this to the RandomState for each function call.
Imo, as Gymnasium and other projects use np.random.Generator then it makes it difficult to easily change to using jumpy rather than numpy.

Therefore, the proposal is to create a jp.random.Generator object that is equivalent to np.random.Generator for numpy and for jumpy, behind the scenes we store the key and split the prng and return the results.

To consider is if the object inherits from np.random.Generator with functions being overrides with a check if numpy or jax is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions