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.

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

Extract distribution parameters from the node's inputs

SymbolicRandomVariable.do_constant_folding(...)

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

SymbolicRandomVariable.get_input_output_type_idxs(...)

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

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

Extract the rng parameters from the node's inputs

SymbolicRandomVariable.size_param(node)

Extract the size parameter from the node's inputs

SymbolicRandomVariable.update(node)

Symbolic update expression for input random state variables

Attributes

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.

extended_signature

Numpy-like vectorized signature of the distribution.

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

ndims_params

otypes

signature

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.