optim.POCSBlock#
- class bartorch.optim.POCSBlock#
Bases:
ModuleOne sweep of the projections,
italgos.c’spocs.Every projection is applied in turn, in place, and the sweep is the whole of a step:
pocstakes 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 whatPOCSdoes.The projections carry the data and the encoding –
pocsense’s are the measured samples, the range of the coil sensitivities and a sparsity threshold – soAis not read. It is accepted, and ignored, so that the block has the calling convention the others have andbartorch.learning.Unrolledcan 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.priorsterm, which is taken as its proximal operator atmu = 1.
Examples
>>> block = POCSBlock([consistency, sense, sparsity]) >>> state = block.start(kspace) >>> state = block(state) >>> block.output(state)
- start()#
The run’s state.
pocs_recon2clears its result and lets the first projection put the data in, so a run withoutx0starts at zero ofy’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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- output()#
The iterate.
pocsleaves it where the last projection put it.