Skip to content

Package: random

Random-number generation nodes.

This package includes nodes for drawing samples according to basic random distributions (usually outputting arrays), and for managing random seeds and chainable keys. Note that the random sampling nodes here do not interact with the distributions in the distributions package and are for more basic use cases. Importantly, these nodes implement a modern strategy for explicitly reproducible random number generation using splittable/chainable keys.

Nodes in this package:

  • Create Random Seed
    Create a (splittable) random seed for deterministic random number generation.

  • Derive Random Seed
    Derive a new random seed from an initial seed and some data.

  • Draw Random Seed
    Draw a random seed from the currently sequence of deterministic random seeds, if one is set.

  • Random Choice (Array)
    Draw a random subset from the set of integers from 0 to a given total minus 1, without replacement.

  • Random Gamma (Array)
    Draw an array of random numbers from a gamma distribution with a given mean and standard deviation, optionally matching a template array in shape and optionally data type.

  • Random Integers (Array)
    Draw an array of random integers from a uniform distribution with a given low and high value (the high value being exclusive), optionally matching a template array in shape and optionally data type.

  • Random Normal (Array)
    Draw an array of random numbers from a normal distribution with a given mean and standard deviation, optionally matching a template array in shape and optionally data type.

  • Random Numbers (Array)
    Draw an array of random numbers from a passed-in distribution, optionally matching a template array in shape and optionally data type.

  • Random Permute (Array)
    Return an array that has the items in the given array permuted along the first axis.

  • Random Poisson (Array)
    Draw an array of random numbers from a Poisson distribution with a given mean and standard deviation, optionally matching a template array in shape and optionally data type.

  • Random Seed Iterator
    Iterate over an infinite series of random seeds that are derived from an initial seed.

  • Random Truncated Normal (Array)
    Draw an array of random numbers from a truncated normal distribution with a given mean and standard deviation, optionally matching a template array in shape and optionally data type.

  • Random Uniform (Array)
    Draw an array of random numbers from a uniform distribution with a given minimum and maximum value, optionally matching a template array in shape and optionally data type.

  • Split Random Seed
    Manually split a random seed into an array of multiple derived seeds.

  • With Random Seed
    Run the given computational graph with a random seed sequence initialized to the given seed.