random – Low-level random numbers

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

Reference

class theano.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 `RandomVariable`s. For example:

from theano.tensor.random.utils import RandomStream

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

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

theano.tensor.random.random_state_type(name=None)[source]

Return a new Variable whose .type is random_state_type.

class theano.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.