pylops.PyTensorOperator#

class pylops.PyTensorOperator(LOp)[source]#

PyTensor Op which applies a PyLops Linear Operator, including gradient support.

This class “converts” a PyLops LinearOperator class into a PyTensor Op. This applies the LinearOperator in “forward-mode” in self.perform, and applies its adjoint when computing the vector-Jacobian product (self.grad), as that is the analytically correct gradient for linear operators. This class should pass pytensor.gradient.verify_grad.

Parameters
LOppylops.LinearOperator

Methods

L_op(inputs, outputs, output_grads)

Construct a graph for the L-operator.

R_op(inputs, eval_points)

Construct a graph for the R-operator.

__init__(LOp)

add_tag_trace(thing[, user_line])

Add tag.trace to a node or variable.

do_constant_folding(fgraph, node)

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

grad(inputs, output_grads)

Construct a graph for the gradient with respect to each input variable.

make_node(x)

Construct an Apply node that represent the application of this operation to the given inputs.

make_py_thunk(node, storage_map, ...[, debug])

Make a Python thunk.

make_thunk(node, storage_map, compute_map, ...)

Create a thunk.

perform(node, inputs, output_storage)

Calculate the function on the inputs and put the variables in the output storage.

prepare_node(node, storage_map, compute_map, ...)

Make any special modifications that the Op needs before doing Op.make_thunk.

Examples using pylops.PyTensorOperator#

Bayesian Linear Regression

Bayesian Linear Regression