Skip to content
Discussion options

You must be logged in to vote

You can see how jax.random.uniform is implemented here: https://github.com/google/jax/blob/16b3f00e42122d6be07a5bb1f8025fe4e3d1dd47/jax/_src/random.py#L425-L436

floats here are floating point numbers with an exponent of zero, lying between 0 (inclusive) and 1 (exclusive): they are then shifted to be between minval (inclusive) and maxval (exclusive).

Generating uniform random numbers with an exclusive minimum value would not be easy to do directly: it would essentially involve generating all mantissas except zero, which is difficult to do in a non-iterative fashion given source randomness coming from random bits.

The easiest way to do this will probably be using a variation of what you sug…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@abhinavprao
Comment options

Answer selected by abhinavprao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants