interop.to_deepinv

Contents

interop.to_deepinv#

bartorch.interop.to_deepinv()#

Wrap a LinearOperator as a deepinv.physics.LinearPhysics.

A and A_adjoint apply the operator and its adjoint, differentiably; a tensor with one more axis than the operator’s shape is a batch, applied item by item. A_dagger solves by bartorch.optim.CG.

Parameters:
  • op (LinearOperator) – Operator, kept alive as long as the physics.

  • **kwargs – maxiter (30), lambda_ (0.0) and tol (1e-6), the defaults of A_dagger, each overridable per call; anything else is passed to LinearPhysics, such as a noise_model.

Returns:

The physics, with the operator as its op attribute.

Return type:

deepinv.physics.LinearPhysics

Raises:

ImportError – deepinv is not installed.

Examples

>>> physics = interop.to_deepinv(linop.NoncartesianSense(maps, (128, 128), traj=traj))
>>> physics.A_dagger(kspace[None]).shape       # a batch of one
torch.Size([1, 128, 128])