pymc.Minibatch.eval#
- Minibatch.eval(inputs_to_values=None)#
Evaluate the Variable.
- Parameters
- inputs_to_values
A dictionary mapping Aesara Variables to values.
Notes
eval()will be slow the first time you call it on a variable – it needs to callfunction()to compile the expression behind the scenes. Subsequent calls toeval()on that same variable will be fast, because the variable caches the compiled function.This way of computing has more overhead than a normal Aesara function, so don’t use it too much in real scripts.
Examples
>>> import numpy as np >>> import aesara.tensor as at >>> x = at.dscalar('x') >>> y = at.dscalar('y') >>> z = x + y >>> np.allclose(z.eval({x : 16.3, y : 12.1}), 28.4) True
We passed
eval()a dictionary mapping symbolic Aesara Variables to the values to substitute for them, and it returned the numerical value of the expression.