optim.POCSBlock#

class bartorch.optim.POCSBlock#

Bases: Module

One sweep of the projections, italgos.c’s pocs.

Every projection is applied in turn, in place, and the sweep is the whole of a step: pocs takes no step size, keeps no momentum and reads no residual, so the state is the iterate alone. Repeating the sweep is the method, which is what POCS does.

The projections carry the data and the encoding – pocsense’s are the measured samples, the range of the coil sensitivities and a sparsity threshold – so A is not read. It is accepted, and ignored, so that the block has the calling convention the others have and bartorch.learning.Unrolled can stack it.

Parameters:

projections (sequence) – The sets to project onto, applied in the order given. Each is a callable mapping a tensor to a tensor, or a bartorch.priors term, which is taken as its proximal operator at mu = 1.

Examples

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

The run’s state.

pocs_recon2 clears its result and lets the first projection put the data in, so a run without x0 starts at zero of y’s shape.

forward()#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

output()#

The iterate. pocs leaves it where the last projection put it.