pymc.SymbolicRandomVariable#
- class pymc.SymbolicRandomVariable(*args, ndim_supp, **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, ...)Initialitze a SymbolicRandomVariable class.
Add tag.trace to a node or variable.
Clone the Op and its inner-graph.
Return connection pattern of subfgraph defined by inputs and outputs.
Determine whether or not constant folding should be performed for the given node.
Try to get parameters for the Op when
Op.params_typeis set to a ParamsType.SymbolicRandomVariable.grad(inputs, output_grads)Construct a graph for the gradient with respect to each input variable.
SymbolicRandomVariable.infer_shape(fgraph, ...)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().Set gradient overrides.
Set L_op overrides This will completely remove any previously set L_op/gradient overrides
Set R_op overrides This will completely remove any previously set R_op overrides
Symbolic update expression for input random state variables
Attributes
LOP_TYPE_ERR_MSGOV_INP_LEN_ERR_MSGSTYPE_ERR_MSGTYPE_ERR_MSGdefault_outputAn
intthat specifies which outputOp.__call__()should return.destroy_mapA
dictthat maps output indices to the input indices upon which they operate in-place.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_suppNumber of support dimensions as in RandomVariables (0 for scalar, 1 for vector, ...)
otypesparams_typeview_mapA
dictthat maps output indices to the input indices of which they are a view.