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

PyLops Linear operator

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.

inplace_on_inputs(allowed_inplace_inputs)

Try to return a version of self that tries to inplace in as many as allowed_inplace_inputs.

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