optim.PRIDUBlock#

class bartorch.optim.PRIDUBlock#

Bases: Module

One step of BART’s primal-dual iteration, italgos.c’s chambolle_pock.

The data term is its own dual, updated through its resolvent, and so is every term but the first when that one’s transform is the identity: it becomes the primal step. sigma and tau are sqrt(step) times and over sigma_tau_ratio, divided with eigen by the root of the largest eigenvalue; hogwild decays by 0.95 a step. Each step takes its own sigma and tau unless adaptive_step moves them, and then the state carries them. done is BART’s absolute tolerance on the two residuals. With a term that introduces auxiliary variables the state vector is the image followed by those variables, and output() returns the image alone.

start()#

The run’s state: the split iter2_chambolle_pock makes, zero duals, and the steps.

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()#