optim.PRIDUBlock#

class bartorch.optim.PRIDUBlock#

Bases: Module

One iteration of BART’s primal-dual algorithm, chambolle_pock (italgos.c).

For \(\min_x \tfrac12 \| A x - y \|^2 + \sum_j g_j(G_j x)\). The data term has a dual variable updated through its resolvent, and so does every term except the first when that one’s transform is the identity: it is then the primal proximal step.

Parameters:
  • priors (Regularizer or ImplicitPrior, or an iterable of them) – The terms \(g_j\), with any transform \(G_j\).

  • step (float, default=0.95) – Product \(\sigma \tau\) of the dual and primal step sizes.

  • sigma_tau_ratio (float, default=1.0) – \(\sigma / \tau\), so \(\sigma = \sqrt{\text{step}}\,\text{ratio}\) and \(\tau = \sqrt{\text{step}} / \text{ratio}\).

  • adaptive_step (bool, default=False) – Adapt \(\sigma\) and \(\tau\) at every iteration; the state then carries them.

  • eigen (bool, default=False) – Divide \(\sigma\) and \(\tau\) by the square root of maxeigen() over the encoding and the dual terms.

  • hogwild (bool, default=False) – Relax iteration \(k\) by \(0.95^k\): each variable moves that fraction of the way to its update.

  • cclambda (float, default=0.0) – Weight of an identity added to the normal operator.

  • tol (float, default=1e-4) – The state’s done is set once the primal and dual residuals sum below it; the tolerance is absolute, as in BART.

  • precond (LinearOperator, default=None) – Left preconditioner \(M\) from A.ishape to itself, positive definite (lsqr2_create’s precond_op).

Notes

With a term that has auxiliary variables the state’s x is the image followed by those variables, and output() returns the image alone.

start()#

Initial state of a run.

Parameters:
  • y (tensor) – Data of A.oshape, or (batch, *A.oshape).

  • A (LinearOperator) – Encoding operator.

  • x0 (tensor, default=None) – Starting image; zero when omitted, as in BART.

Returns:

The start, the split of the terms into primal and dual, zero duals, and the step sizes.

Return type:

State

forward()#

Take one iteration from state; returns the next state.

output()#

Image of state, without any auxiliary variables.