utils – Friendly random numbers¶
Since Aesara uses a functional design, producing pseudo-random numbers in a graph is not quite as straightforward as it is in numpy.
The way to think about putting randomness into Aesara’s computations is to put random variables in your graph. Aesara will allocate a numpy RandomState object for each such variable, and draw from it as necessary. We will call this sort of sequence of random numbers a random stream.
For an example of how to use random numbers, see Using Random Numbers.
This is a symbolic stand-in for
Returns: a list of all the (state, new_state) update pairs for the random variables created by this object
This can be a convenient shortcut to enumerating all the random variables in a large graph in the
updateparameter of function.
meta_seedwill be used to seed a temporary random number generator, that will in turn generate seeds for all random variables created by this object (via
gen(op, *args, **kwargs)¶
Return the random variable from
op(*args, **kwargs), but also install special attributes (
RandomVariable) into it.
This function also adds the returned variable to an internal list so that it can be seeded later by a call to
uniform, normal, binomial, multinomial, random_integers, ...