megengine.random#

RNG

RNG exposes a number of methods for generating random numbers.

seed

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(0, 1)$.

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)\).