pymc.SymbolicRandomVariable#

class pymc.SymbolicRandomVariable(*args, **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, **kwargs)

Initialize a SymbolicRandomVariable class.

SymbolicRandomVariable.add_tag_trace(thing)

Add tag.trace to a node or variable.

SymbolicRandomVariable.batch_ndim(node)

Number of dimensions of the distribution's batch shape.

SymbolicRandomVariable.clone()

Clone the Op and its inner-graph.

SymbolicRandomVariable.connection_pattern(node)

Return connection pattern of subfgraph defined by inputs and outputs.

SymbolicRandomVariable.do_constant_folding(...)

Determine whether or not constant folding should be performed for the given node.

SymbolicRandomVariable.get_lop_op()

SymbolicRandomVariable.get_rop_op()

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().

SymbolicRandomVariable.set_grad_overrides(...)

Set gradient overrides.

SymbolicRandomVariable.set_lop_overrides(...)

Set L_op overrides This will completely remove any previously set L_op/gradient overrides

SymbolicRandomVariable.set_rop_overrides(...)

Set R_op overrides This will completely remove any previously set R_op overrides

SymbolicRandomVariable.update(node)

Symbolic update expression for input random state variables

Attributes

LOP_TYPE_ERR_MSG

OV_INP_LEN_ERR_MSG

STYPE_ERR_MSG

TYPE_ERR_MSG

default_output

An int that specifies which output Op.__call__() should return.

destroy_map

A dict that maps output indices to the input indices upon which they operate in-place.

fn

Lazily compile the inner function graph.

inline_logprob

Specifies whether the logprob function is derived automatically by introspection of the inner graph.

inner_inputs

The inner function's inputs.

inner_outputs

The inner function's outputs.

itypes

ndim_supp

Number of support dimensions as in RandomVariables (0 for scalar, 1 for vector, ...)

ndims_params

Number of core dimensions of the distribution's parameters.

otypes

signature

Numpy-like vectorized signature of the distribution.

view_map

A dict that maps output indices to the input indices of which they are a view.

fgraph

A FunctionGraph of the inner function.