megengine.random

RNG

RNG exposes a number of methods for generating random numbers.

seed

Sets the seed for generating random numbers globally.

permutation

Randomly permute a sequence, or return a permuted range.

shuffle

Modify a sequence in-place by shuffling its contents.

分布(Distribution)

normal

Random variable with Gaussian distribution \(N(\mu, \sigma)\).

uniform

Random variable with uniform distribution \(U(low, high)\).

beta

Random variable with Beta distribution \(\operatorname{Beta}(\alpha, \beta)\).

gamma

Random variable with Gamma distribution \(\Gamma(k, \theta)\).

poisson

Random variable with poisson distribution \(\operatorname{Poisson}(\lambda)\).