hyri.optimiser.forward_backward#

Define the shared forward-backward optimiser implementation.

This module provides the forward-backward backbone used by the AIRI and SARA optimisers. It handles the common forward step, proximal backward step, timing, and heuristic noise-level estimation shared by those variants.

Class

ForwardBackward

Represent a shared forward-backward optimisation backbone.

class hyri.optimiser.forward_backward.ForwardBackward(meas: list[Tensor], ch_freq: Tensor, meas_op: MeasOp, regulariser: Regulariser, meas_op_precise: MeasOp | None = None, heu_noise_scale: float = 1.0, im_max_itr: int = 2000, save_pth: str = 'results', file_prefix: str = '', rank_ch_start: int = 0)#

Bases: Optimiser

Represent a shared forward-backward optimisation backbone.

This class implements a forward-backward scheme in which the data-fidelity term is differentiable and the regularisation term is applied through a backward proximal step. Concrete optimiser subclasses define the initialisation, stopping criterion, per-iteration bookkeeping, and finalisation policy on top of this common loop.

_meas_op_precise#

Measurement operator used to compute the dirty image, PSF, and norm-based heuristics.

Type:

MeasOp

_heu_noise_scale#

User-defined multiplicative scaling applied to heuristic noise levels.

Type:

float

_regulariser#

Regulariser or proximal operator used in the backward step.

Type:

Regulariser

_start_iter#

Starting iteration index.

Type:

int

_im_max_itr#

Maximum number of forward-backward iterations.

Type:

int

_gd_step_size#

Forward-step gradient-descent step size.

Type:

float

_t_total#

Total optimisation time in seconds.

Type:

float

_t_iter#

Last iteration time in seconds.

Type:

float

_t_forward#

Last forward-step time in seconds.

Type:

float

_t_backward#

Last backward-step time in seconds.

Type:

float

_iter#

Current iteration index.

Type:

int

_forward_cuda_timing#

Whether CUDA events time the forward step.

Type:

bool

_backward_cuda_timing#

Whether CUDA events time the backward step.

Type:

bool

_psf_peak#

Per-channel PSF peak values.

Type:

torch.Tensor

_heuristic#

Cached heuristic noise levels.

Type:

torch.Tensor | None

References

Combettes, P. L., & Pesquet, J.-C. (2011). Proximal splitting methods in signal processing. In H. H. Bauschke, R. S. Burachik, P. L. Combettes, V. Elser, D. R. Luke, & H. Wolkowicz (Eds.), Fixed-point algorithms for inverse problems in science and engineering (pp. 185-212). Springer.

Initialise the shared forward-backward optimiser state.

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

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

  • meas_op (MeasOp) – Measurement operator used inside the iterative forward step.

  • regulariser (Regulariser) – Regulariser or proximal operator applied in the backward step.

  • meas_op_precise (MeasOp | None, optional) – Measurement operator used for dirty-image, PSF, and heuristic calculations. If None, reuses meas_op. Default: None.

  • heu_noise_scale (float, optional) – User-specified multiplicative factor applied to heuristic noise estimates. Default: 1.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: "".

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

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 forward-backward optimisation loop.

This method alternates a gradient-descent step on the differentiable data-fidelity term with a proximal regularisation step until the subclass-defined stopping criterion is met or the maximum iteration count is reached.

_calculate_channel_wise_heuristic() → None#

Compute heuristic noise levels for local channels.

The heuristic is derived from channel-wise operator norms and can be corrected for twice-applied image weighting and scaled by the user-provided heu_noise_scale factor.

For each local channel, the base heuristic is computed as \(h_c = 1 / \sqrt{2 L_c}\), where \(L_c = \lVert \Phi_c^\dagger \Phi_c \rVert_\mathrm{S}\) is the channel-wise operator norm returned by self._meas_op_precise.get_op_norm_ch().

If the image weighting is integrated, the heuristic noise level is corrected by the factor \(\sqrt{L^\prime_c / L_c}\), where \(L^\prime_c = \lVert \Phi_c^\dagger W^\dagger W \Phi_c \rVert_\mathrm{S}\).

Returns:

The heuristic is stored in self._heuristic.

Return type:

None

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.