optim.PRIDU#
- class bartorch.optim.PRIDU#
Bases:
Primal-dual iteration (Chambolle-Pock), looping
PRIDUBlock.Solves \(\min_x \tfrac12 \| A x - y \|^2 + \sum_j g_j(G_j x)\) with no inner solve.
- Parameters:
regularizers (Regularizer or ImplicitPrior, or an iterable of them, default=None) – The terms \(g_j\), with any transform \(G_j\), including terms with auxiliary variables.
maxiter (int, default=30) – Maximum number of iterations.
step (float, default=0.95) – Product of the dual and primal step sizes, \(\sigma \tau\).
sigma_tau_ratio (float, default=1.0) – \(\sigma / \tau\), so \(\sigma = \sqrt{\text{step}}\,\text{ratio}\) and \(\tau = \sqrt{\text{step}} / \text{ratio}\). BART’s reconstructions set it to the
data_scaling()factor.adaptive_step (bool, default=False) – Adapt \(\sigma\) and \(\tau\) at every iteration.
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.
precond (LinearOperator, default=None) – Left preconditioner \(M\) from
A.ishapeto itself, positive definite (lsqr2_create’sprecond_op); BART’s reconstructions use none.
Notes
The first term is applied as the primal proximal step when its transform is the identity, and every other term through a dual variable. The run stops early when the primal and dual residuals sum below 1e-4.
- __call__()#
Solve for the image.
- Parameters:
y (tensor) – Data of
A.oshape, or(batch, *A.oshape); a batch is solved one item at a time, each as its own run.A (LinearOperator) – Encoding operator. A BART-backed operator is applied inside the library; a Python-defined one is called back once per application.
x0 (tensor, default=None) – Starting image of
A.ishape, or one per batch item; zero when omitted.
- Returns:
Complex64 image of
A.ishape, withy’s batch axis in front.- Return type:
torch.Tensor
- Raises:
ValueError –
yrequires a gradient and a BART term has not been detached (detach()): its proximal operator has no backward pass.
Notes
The iterations are torch operations, so a solve is differentiated by unrolling. Step sizes and weights are fixed;
bartorch.optim’s blocks andUnrolledexpose them as parameters.