basic – Low-level random numbers

The aesara.tensor.random module provides random-number drawing functionality that closely resembles the numpy.random module.


class aesara.tensor.random.RandomStream[source]

A helper class that tracks changes in a shared numpy.random.RandomState and behaves like numpy.random.RandomState by managing access to RandomVariables. For example:

from aesara.tensor.random.utils import RandomStream

rng = RandomStream()
sample = rng.normal(0, 1, size=(2, 2))
class aesara.tensor.random.RandomStateType(Type)[source]

A Type for variables that will take numpy.random.RandomState values.


Return a new Variable whose Variable.type is an instance of RandomStateType.

class aesara.tensor.random.RandomVariable(Op)[source]

Op that draws random numbers from a numpy.random.RandomState object. This Op is parameterized to draw numbers from many possible distributions.