ReductionOperator.derivative¶
-
ReductionOperator.
derivative
(self, x)[source]¶ Derivative of the reduction operator.
- Parameters
- x
domain
element The point to take the derivative in.
- x
- Returns
- derivativelinear
BroadcastOperator
- derivativelinear
Examples
>>> r3 = odl.rn(3) >>> I = odl.IdentityOperator(r3) >>> x = [1.0, 2.0, 3.0] >>> y = [4.0, 6.0, 8.0]
Example with linear operator (derivative is itself)
>>> op = ReductionOperator(I, 2 * I) >>> op([x, y]) rn(3).element([ 9., 14., 19.]) >>> op.derivative([x, y])([x, y]) rn(3).element([ 9., 14., 19.])
Example with affine operator
>>> residual_op = I - r3.element([1, 1, 1]) >>> op = ReductionOperator(residual_op, 2 * residual_op)
Calling operator gives offset by [3, 3, 3]
>>> op([x, y]) rn(3).element([ 6., 11., 16.])
Derivative of affine operator does not have this offset
>>> op.derivative([x, y])([x, y]) rn(3).element([ 9., 14., 19.])