optim.POCSBlock#

class bartorch.optim.POCSBlock#

Bases: Module

One sweep of projections onto convex sets, BART’s pocs (italgos.c).

A step applies every projection in turn; there is no step size, momentum or residual, so the state is the iterate alone. The projections carry the data and the encoding – for pocsense, the measured samples, the range of the coil sensitivities and a sparsity threshold – so A is accepted and ignored, giving the block the calling convention of the others for bartorch.learning.Unrolled.

Parameters:

projections (sequence) – Applied in the order given. Each is a callable mapping a tensor to a tensor, or a bartorch.priors term, applied as its proximal operator at unit step.

Raises:
  • TypeError – A projection is neither callable nor a term.

  • ValueError – projections is empty.

Examples

>>> block = POCSBlock([consistency, sense, sparsity])
>>> state = block.start(kspace)
>>> state = block(state)
>>> block.output(state)
start()#

Initial state: x0, or zero of y’s shape, as pocs_recon2 starts.

y fixes the shape, dtype and device of the zero start; its values are not read.

forward()#

Apply every projection once; returns the next state.

output()#

The iterate as the last projection left it.