Contains operations relating to pseudo-random number generation.
| Static member |
Description
|
Full Usage:
Random.Bernoulli()
Returns: float
|
Samples a random value from the Bernoulli distribution.
|
Full Usage:
Random.Bernoulli(prob)
Parameters:
float
Returns: float
|
Samples a random value from the Bernoulli distribution with the given probability.
|
Full Usage:
Random.Choice(array, probs)
Parameters:
'a[]
probs : float[]
Returns: 'a
Type parameters: 'a |
Samples a value at random from the given array using the given categorical probabilities.
|
Full Usage:
Random.Choice(array)
Parameters:
'a[]
Returns: 'a
Type parameters: 'a |
Samples a value at random from the given array.
|
Full Usage:
Random.ChoiceIndex(probs)
Parameters:
float[]
Returns: int
|
Samples an index at random with the given categorical probabilities.
|
Full Usage:
Random.Double(low, high)
Parameters:
float
high : float
Returns: float
|
Samples a double value in the given range [low, high)
|
Full Usage:
Random.Double()
Returns: float
|
Samples a double value in the range [0, 1)
|
Full Usage:
Random.Integer(low, high)
Parameters:
int
high : int
Returns: int
|
Samples a random integer in the given range [low, high).
|
Full Usage:
Random.Integer()
Returns: int
|
Samples a non-negative random integer
|
Full Usage:
Random.Multinomial(probs, numSamples)
Parameters:
float[,]
numSamples : int
Returns: int[,]
|
Returns a 2D array where each row contains `numSamples` indices sampled from the multinomial probability distribution defined by the probabilities in the corresponding row of the `probs` array.
|
Full Usage:
Random.Multinomial(probs, numSamples)
Parameters:
float[]
numSamples : int
Returns: int array
|
Samples a number of random values array of random values for the given weighted distribution
|
Full Usage:
Random.Normal(mean, stddev)
Parameters:
float
stddev : float
Returns: float
|
Samples a random value from the normal distribution with the given mean and standard deviation.
|
Full Usage:
Random.Normal()
Returns: float
|
Samples a random value from the standard normal distribution with mean 0 and standard deviation 1.
|
Full Usage:
Random.Seed(seed)
Parameters:
int
|
Sets the random seed.
|
Full Usage:
Random.Shuffle(array)
Parameters:
'a[]
Returns: 'a array
Type parameters: 'a |
Returns an array that is a randomly-shuffled version of the given array, using the Durstenfeld/Knuth shuffle.
|
Full Usage:
Random.UUID()
Returns: string
|
Returns a universally unique identifier (UUID) string
|
Full Usage:
Random.Uniform(low, high)
Parameters:
float
high : float
Returns: float
|
Samples a random value from the uniform distribution with the given parameters [low, high).
|
Full Usage:
Random.Uniform()
Returns: float
|
Samples a random value from the standard uniform distribution over the interval [0,1).
|
© Copyright 2021, DiffSharp and dfx Contributors.