CPIteration

class deepinv.optim.optim_iterators.CPIteration(**kwargs)[source]

Bases: OptimIterator

Iterator for Chambolle-Pock.

Class for a single iteration of the Chambolle-Pock Primal-Dual (PD) algorithm for minimising \(F(Kx) + \lambda G(x)\) or \(\lambda F(x) + G(Kx)\) for generic functions \(F\) and \(G\). Our implementation corresponds to Algorithm 1 of https://hal.science/hal-00490826/document.

If the attribute g_first is set to False (by default), the iteration is given by

\[\begin{split}\begin{equation*} \begin{aligned} u_{k+1} &= \operatorname{prox}_{\sigma F^*}(u_k + \sigma K z_k) \\ x_{k+1} &= \operatorname{prox}_{\tau \lambda G}(x_k-\tau K^\top u_{k+1}) \\ z_{k+1} &= x_{k+1} + \beta(x_{k+1}-x_k) \\ \end{aligned} \end{equation*}\end{split}\]

where \(F^*\) is the Fenchel-Legendre conjugate of \(F\), \(\beta>0\) is a relaxation parameter, and \(\sigma\) and \(\tau\) are step-sizes that should satisfy \(\sigma \tau \|K\|^2 \leq 1\).

If the attribute g_first is set to True, the functions \(F\) and \(G\) are inverted in the previous iteration.

In particular, setting \(F = \distancename\), \(K = A\) and \(G = \regname\), the above algorithms solves

\[\begin{equation*} \underset{x}{\operatorname{min}} \,\, \distancename(Ax, y) + \lambda \regname(x) \end{equation*}\]

with a splitting on \(\distancename\), with not differentiability assumption needed on \(\distancename\) or \(\regname\), not any invertibility assumption on \(A\).

Note that the algorithm requires an intiliazation of the three variables \(x_0\), \(z_0\) and \(u_0\).

forward(X, cur_data_fidelity, cur_prior, cur_params, y, physics)[source]

Single iteration of the Chambolle-Pock algorithm.

Parameters:
  • X (dict) – Dictionary containing the current iterate and the estimated cost.

  • cur_data_fidelity (deepinv.optim.DataFidelity) – Instance of the DataFidelity class defining the current data_fidelity.

  • cur_prior (deepinv.optim.Prior) – Instance of the Prior class defining the current prior.

  • cur_params (dict) – dictionary containing the current parameters of the algorithm.

  • y (torch.Tensor) – Input data.

  • physics (deepinv.physics) – Instance of the physics modeling the data-fidelity term.

Returns:

Dictionary {“est”: (x, ), “cost”: F} containing the updated current iterate and the estimated current cost.

Examples using CPIteration:

Learned Primal-Dual algorithm for CT scan.

Learned Primal-Dual algorithm for CT scan.