jaxvacua.util.random_uniform

Contents

jaxvacua.util.random_uniform#

random_uniform(lower_bound, upper_bound, rns_key=None, seed=42, shape=(1,))#

Sample uniformly distributed real numbers on [lower_bound, upper_bound).

Parameters:
  • lower_bound (float) – Lower edge of the sampling interval.

  • upper_bound (float) – Upper edge of the sampling interval (exclusive).

  • rns_key (Union[PRNGSequence, Array, None]) – Key source. If None, a fresh PRNGSequence(seed) is created. If a PRNGSequence, next() is called to obtain a subkey. If a raw JAX PRNG key, it’s used directly.

  • seed (int) – Seed used when rns_key is None. Default 42.

  • shape (Tuple[int, ...]) – Output shape. Default (1,).

Returns:

Array – Uniform samples of shape shape and dtype DTYPE.

Return type:

Array