Module random

Source
Expand description

Collection of functions related to random number generation

Enums§

ShapeOrCount
Shape or count for the categorical distribution.

Functions§

bernoulli
Generate Bernoulli random values with a given p value.
bernoulli_device
Generate Bernoulli random values with a given p value.
categorical
Sample from a categorical distribution.
categorical_device
Sample from a categorical distribution.
gumbel
Sample from the standard Gumbel distribution.
gumbel_device
Sample from the standard Gumbel distribution.
key
Get a PRNG key from a seed.
multivariate_normal
Generate jointly-normal random samples given a mean and covariance.
multivariate_normal_device
Generate jointly-normal random samples given a mean and covariance.
normal
Generate normally distributed random numbers.
normal_device
Generate normally distributed random numbers.
randint
Generate random integers from the given interval (lower: and upper:).
randint_device
Generate random integers from the given interval (lower: and upper:).
seed
Seed the random number generator.
split
Split a PRNG key into two keys and return a tuple.
split_device
Split a PRNG key into two keys and return a tuple.
truncated_normal
Generate values from a truncated normal distribution between low and high.
truncated_normal_device
Generate values from a truncated normal distribution between low and high.
uniform
Generate uniformly distributed random numbers. The values are sampled uniformly in the half-open interval [lower, upper). The lower and upper bound can be scalars or arrays and must be broadcastable to shape.
uniform_device
Generate uniformly distributed random numbers. The values are sampled uniformly in the half-open interval [lower, upper). The lower and upper bound can be scalars or arrays and must be broadcastable to shape.