pymc.SymbolicRandomVariable#
- class pymc.SymbolicRandomVariable(*args, extended_signature=None, **kwargs)[source]#
Symbolic Random Variable.
This is a subclasse of OpFromGraph which is used to encapsulate the symbolic random graph of complex distributions which are built on top of pure `RandomVariable`s.
These graphs may vary structurally based on the inputs (e.g., their dimensionality), and usually require that random inputs have specific shapes for correct outputs (e.g., avoiding broadcasting of random inputs). Due to this, most distributions that return SymbolicRandomVariable create their these graphs at runtime via the classmethod cls.rv_op, taking care to clone and resize random inputs, if needed.
Methods
SymbolicRandomVariable.L_op(inputs, outputs, ...)Construct a graph for the L-operator.
SymbolicRandomVariable.R_op(inputs, eval_points)Construct a graph for the R-operator.
SymbolicRandomVariable.__init__(*args[, ...])Initialize a SymbolicRandomVariable class.
Add tag.trace to a node or variable.
Return the number of dimensions of the distribution's batch shape.
Clone the Op and its inner-graph.
Return connection pattern of subfgraph defined by inputs and outputs.
Extract distribution parameters from the node's inputs.
Determine whether or not constant folding should be performed for the given node.
Parse extended_signature and return indexes for *[rng], [size] and parameters as well as outputs.
SymbolicRandomVariable.grad(inputs, output_grads)Construct a graph for the gradient with respect to each input variable.
SymbolicRandomVariable.infer_shape(fgraph, ...)Try to return a version of self that tries to inplace in as many as allowed_inplace_inputs.
SymbolicRandomVariable.make_node(*inputs)Construct an Apply node that represent the application of this operation to the given inputs.
SymbolicRandomVariable.make_py_thunk(node, ...)Make a Python thunk.
SymbolicRandomVariable.make_thunk(node, ...)Create a thunk.
SymbolicRandomVariable.perform(node, inputs, ...)Calculate the function on the inputs and put the variables in the output storage.
SymbolicRandomVariable.prepare_node(node, ...)Make any special modifications that the Op needs before doing
Op.make_thunk().Extract the rng parameters from the node's inputs.
Extract the size parameter from the node's inputs.
Symbolic update expression for input random state variables.
Attributes
default_outputAn
intthat specifies which outputOp.__call__()should return.destroy_mapA
dictthat maps output indices to the input indices upon which they operate in-place.extended_signatureNumpy-like vectorized signature of the distribution.
fnLazily compile the inner function graph.
inline_logprobSpecifies whether the logprob function is derived automatically by introspection of the inner graph.
inner_inputsThe inner function's inputs.
inner_outputsThe inner function's outputs.
itypesndim_suppndims_paramsotypessignatureview_mapA
dictthat maps output indices to the input indices of which they are a view.fgraphA FunctionGraph of the inner function.