Skip to main content

Module random

Module random 

Source
Expand description

Collection of functions related to random number generation

Structs§

RandomState
Random state for reproducible random number generation.

Enums§

ShapeOrCount
Shape or count for the categorical distribution.

Functions§

bernoulli
Generate Bernoulli random values with a given p value.
bernoulli_deviceDeprecated
Compatibility shim for bernoulli.
categorical
Sample from a categorical distribution.
categorical_deviceDeprecated
Compatibility shim for categorical.
gumbel
Sample from the standard Gumbel distribution.
gumbel_deviceDeprecated
Compatibility shim for gumbel.
key
Get a PRNG key from a seed.
multivariate_normal
Generate jointly-normal random samples given a mean and covariance.
multivariate_normal_deviceDeprecated
Compatibility shim for multivariate_normal.
normal
Generate normally distributed random numbers.
normal_deviceDeprecated
Compatibility shim for normal.
randint
Generate random integers from the given interval (lower: and upper:).
randint_deviceDeprecated
Compatibility shim for randint.
seed
Seed the current thread’s default random number generator.
split
Split a PRNG key into two keys and return a tuple.
split_deviceDeprecated
Compatibility shim for split.
truncated_normal
Generate values from a truncated normal distribution between low and high.
truncated_normal_deviceDeprecated
Compatibility shim for truncated_normal.
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_deviceDeprecated
Compatibility shim for uniform.
with_random_state
Use the given random state for the scope of f