hyri.optimiser.primal_dual#

Define the shared primal-dual optimiser implementation.

This module provides a primal-dual backbone with a preconditioned dual update for data fidelity and a proximal primal update for regularisation.

Class

PrimalDualPrecond

Represent a preconditioned primal-dual optimisation backbone.

class hyri.optimiser.primal_dual.PrimalDualPrecond(meas: list[Tensor], ch_freq: Tensor, meas_op: MeasOpHyperspectral, regulariser_prime: Regulariser, regulariser_dual_data: ProxEllipsoid, heu_noise_scale: float = 1.0, rank_ch_start: int = 0, im_max_itr: int = 2000, save_pth: str = 'results', file_prefix: str = '')#

Bases: Optimiser

Represent a preconditioned primal-dual optimisation backbone.

This class implements a primal-dual splitting scheme with two non-differentiable terms. The preconditioned data-fidelity term is handled through a dual update, while the regularisation term is handled through a proximal update of the primal image variable.

Shape:
  • Image tensor – (1, C_rank, H, W).

  • Visibility tensor – tuple of C_rank tensors, each with shape (1, 1, N_c).

  • Frequency tensor – (1, C_total, 1, 1) after reshaping in the base optimiser.

_regulariser_prime#

Proximal regulariser applied to the primal image variable.

Type:

Regulariser

_regulariser_dual_data#

Proximal operator applied to the dual data variable.

Type:

ProxEllipsoid

_heu_noise_scale#

User-defined multiplicative scaling applied to heuristic noise levels.

Type:

float

_start_iter#

Starting iteration index.

Type:

int

_im_max_itr#

Maximum number of primal-dual iterations.

Type:

int

_pr_step_size#

Primal step size.

Type:

float

_precond_weight#

Channel-wise preconditioning weights applied in the adjoint dual update.

Type:

list[torch.Tensor]

_dual#

Dual variables associated with the visibility-domain data-fidelity term.

Type:

list[torch.Tensor]

_iter#

Current iteration index.

Type:

int

_t_total#

Total optimisation time in seconds.

Type:

float

_t_iter#

Last iteration time in seconds.

Type:

float

_t_primal#

Last primal-step time in seconds.

Type:

float

_t_dual#

Last dual-step time in seconds.

Type:

float

_cuda_timing#

Whether CUDA events are used for timing.

Type:

bool

_psf_peak#

Per-channel PSF peak values.

Type:

torch.Tensor

_heuristic#

Cached heuristic noise levels.

Type:

torch.Tensor | None

References

Condat, L. (2013). A Primal-Dual Splitting Method for Convex Optimization Involving Lipschitzian, Proximable and Linear Composite Terms. J. Optim. Theory Appl., 158, 460-479.

Initialise the shared primal-dual optimiser state.

Parameters:
  • meas (List[torch.Tensor]) – Local measurement tensors, typically one tensor per local channel.

  • ch_freq (torch.Tensor) – Frequencies for all spectral channels.

  • meas_op (MeasOpHyperspectral) – Hyperspectral measurement operator.

  • regulariser_prime (Regulariser) – Proximal regulariser applied to the primal image variable.

  • regulariser_dual_data (ProxEllipsoid) – Proximal operator applied to the dual data variable.

  • heu_noise_scale (float, optional) – User-specified multiplicative factor applied to heuristic noise estimates. Default: 1.0.

  • rank_ch_start (int, optional) – Global starting channel index owned by the current rank. Default: 0.

  • im_max_itr (int, optional) – Maximum number of iterations. Default: 2000.

  • save_pth (str, optional) – Directory where optimiser products are saved. Default: "results".

  • file_prefix (str, optional) – Prefix prepended to saved file names. Default: "".

Note

This constructor computes and stores the dirty image and PSF before the main optimisation loop starts, then writes them to FITS files on rank 0.

run() → None#

Run the primal-dual optimisation loop.

This method alternates a primal proximal update in the image domain with a dual proximal update in the visibility domain until the subclass-defined stopping criterion is met or the maximum iteration count is reached.

_calculate_channel_wise_heuristic() → None#

Calculate channel-wise heuristic noise levels.

The base heuristic is defined as

\[h_c = \frac{1}{\sqrt{2 L_c}},\]

where \(L_c = \|\Phi_c^\dagger \Phi_c\|_S\) is the channel-wise operator norm returned by self._meas_op.get_op_norm_ch(). The heuristic is then optionally corrected with self._meas_op.get_op_norm_prime_ch() and scaled by the user-provided factor self._heu_noise_scale.

The result is stored in self._heuristic with shape (1, C_rank, 1, 1).

References

Terris, M., Dabbech, A., Tang, C., & Wiaux, Y. (2023). Image reconstruction algorithms in radio interferometry: From handcrafted to learned regularization denoisers. MNRAS, 518(1), 604-622.

Wilber, A. G., Dabbech, A., Jackson, A., & Wiaux, Y. (2023). Scalable precision wide-field imaging in radio interferometry: I. uSARA validated on ASKAP data. MNRAS, 522(4), 5558-5575.