Nonlinear operators#

bartorch.nlop represents a nonlinear operator \(F\) from one or more inputs to one or more outputs, with its derivative \(DF_x\) at a point and the adjoint of that derivative. F(*x) evaluates it, F.linearize(*x) returns \(DF_x\) as a LinearOperator, a @ b composes (applying b first, either side possibly linear), and F.partial(i, value) fixes input i. Nonlinear forward models describes the reconstruction problems these operators model, and Differentiation through reconstruction how they and the Gauss-Newton steps enter autograd.

Operator class#

Object

Description

NonlinearOperator

Base class: evaluation, derivative and its adjoint, composition, partial application, linearization

TorchOperator

Nonlinear operator from a differentiable PyTorch function, with derivative and adjoint from autograd

MRI encoding models#

Object

Inputs

Model

NonlinearSense

Image, Sobolev-weighted coil coefficients

BART’s noir model, \(y_c = PF(S_c x)\) with sensitivities \(S_c\) estimated jointly

CartesianSense

Image, coil coefficients

NonlinearSense on a Cartesian grid

NoncartesianSense

Image, coil coefficients

NonlinearSense along a trajectory

CoilSense

Image, sensitivities

Product of image and unweighted sensitivities in front of any linear encoding

Signal models#

Quantitative signal models evaluated by TorchSim; each maps parameter maps to one image per contrast.

Object

Unknowns

Signal

SignalModel

Any TorchSim model’s parameters

Base class: a TorchSim ModelOperator as a nonlinear operator

InversionRecovery

\(T_1\), optional complex amplitude

Inversion recovery at a series of inversion times

MultiEcho

\(T_2\) or \(T_2^*\), optional complex amplitude

Mono-exponential decay at a series of echo times

Bloch

Any simulated tissue property

Bloch simulation of a TorchSim sequence

Elementary operators#

Object

Description

Multiply

Pointwise product of two inputs, with broadcasting

Divide

Pointwise quotient of two inputs

Weighted

\(a x + b z\) of two inputs

Constant

Operator of no inputs returning a fixed tensor

Exp

\(e^x\)

Log

\(\log x\)

Sqrt

\(\sqrt{x}\)

Power

\(x^p\)

Add

\(x + c\)

Inverse

\(1/x\)

Abs

\(\lvert x \rvert\)

SmoothAbs

\(\sqrt{\lvert x \rvert^2 + \epsilon}\)

Phase

\(x / \lvert x \rvert\)

SumOfSquares

\(\sum \lvert x \rvert^2\) over axes

RootSumOfSquares

\(\sqrt{\sum \lvert x \rvert^2}\) over axes

Gauss-Newton methods#

Object

Description

IRGNM

Iteratively regularized Gauss-Newton solver for \(F(x) = y\)

IRGNMBlock

One Gauss-Newton step as a torch.nn.Module, for unrolling

irgnm

Functional form of IRGNM

IRGNM(inner=None) solves each linearized problem by conjugate gradients inside BART, as nlinv does; IRGNM(inner=solver) passes it to a solver from bartorch.optim, whose regularization terms then apply to the step.

The examples Nonlinear inversion and Parameter maps straight from k-space use these objects in complete reconstructions.