hyri.optimiser.fb_hyperairi#
Define the hyperspectral AIRI optimiser.
This module provides the HyperAIRI optimiser built on the shared forward-backward backbone with adaptive denoiser selection and spectral-index updates.
Class
Represent the HyperAIRI forward-backward optimiser. |
- class hyri.optimiser.fb_hyperairi.FBHyperAIRI(meas: list[Tensor], ch_freq: Tensor, meas_op: MeasOpHyperspectral, regulariser: DenHyperAIRI, meas_op_approx: MeasOpHyperspectral | None = None, rank_ch_start: int = 0, im_min_itr: int = 100, im_max_itr: int = 2000, im_var_tol: float = 0.0001, im_peak_est: Tensor | None = None, heu_noise_scale: float = 1.0, adapt_net_select: bool = True, peak_tol_min: float = 0.001, peak_tol_max: float = 0.1, peak_tol_step: float = 0.1, spec_update: bool = True, spec_idx_init: Tensor | str = 'dirty', spec_max_update_count: int = 50, spec_max_update_interval: int = 60, spec_update_tol_max: float = 0.0016, spec_update_tol_min: float = 1e-05, spec_update_tol_step: float = 0.5, verbose: bool = True, save_pth: str = 'results', file_prefix: str = '', iter_save: int = 1000)#
Bases:
ForwardBackwardRepresent the HyperAIRI forward-backward optimiser.
This class combines the shared forward-backward optimisation loop with a hyperspectral AIRI denoiser. Besides the image update, it can adapt the denoiser selection from channel-wise peak estimates and refine an internal spectral-index map used by the HyperAIRI regulariser.
- Shape:
Image tensor –
(1, C_rank, H, W).Visibility tensor – tuple of
C_ranktensors, each with shape(1, 1, N_c).Frequency tensor –
(1, C_total, 1, 1)after reshaping in the base optimiser.Spectral-index tensor –
(1, 1, H, W).
- _im_peak_est#
User-provided channel-wise image peak estimates, if any.
- Type:
torch.Tensor | None
- _spec_idx_init#
Initial spectral-index map or its initialisation mode.
- Type:
- _spec_update_tol#
Current relative-variation threshold used to trigger a spectral-index update.
- Type:
- _spec_update_tol_step#
Multiplicative decay factor for the spectral-index update threshold.
- Type:
- _clean_beam#
Clean-beam kernel used for spectral-index estimation.
- Type:
torch.Tensor | None
- _prev_peak_val#
Previous channel-wise image peak estimate.
- Type:
torch.Tensor | None
Example
>>> optimiser = FBHyperAIRI( ... meas=meas, ... ch_freq=ch_freq, ... meas_op=meas_op, ... regulariser=regulariser, ... ) >>> optimiser.initialisation() >>> optimiser.run() >>> optimiser.finalisation()
References
Tang, C., Dabbech, A., Jackson, A., & Wiaux, Y. (2026). HyperAIRI: A Plug-and-play Algorithm for Precise Hyperspectral Image Reconstruction in Radio Interferometry. The Astrophysical Journal Supplement Series, 283(1), 9.
Initialise the HyperAIRI optimiser.
- 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) – Precise hyperspectral measurement operator used for diagnostics and final products.
regulariser (DenHyperAIRI) – HyperAIRI denoising regulariser.
meas_op_approx (MeasOpHyperspectral | None, optional) – Optional approximate measurement operator used during the iterative forward step. Default: None.
rank_ch_start (int, optional) – Global starting channel index owned by the current rank. Default: 0.
im_min_itr (int, optional) – Minimum number of iterations before convergence is checked. Default: 100.
im_max_itr (int, optional) – Maximum number of iterations. Default: 2000.
im_var_tol (float, optional) – Relative-variation tolerance. Default: 1e-4.
im_peak_est (torch.Tensor | None, optional) – User-provided channel-wise image peak estimates. Default: None.
heu_noise_scale (float, optional) – Multiplicative scaling applied to heuristic noise levels. Default: 1.0.
adapt_net_select (bool, optional) – Adapt HyperAIRI denoiser selection during optimisation. Default: True.
peak_tol_min (float, optional) – Minimum allowed relative peak-variation threshold. Default: 1e-3.
peak_tol_max (float, optional) – Initial relative peak-variation threshold. Default: 0.1.
peak_tol_step (float, optional) – Multiplicative decay factor for the peak-variation threshold. Default: 0.1.
spec_update (bool, optional) – Enable spectral-index updates during optimisation. Default: True.
spec_idx_init (torch.Tensor | str, optional) – Initial spectral-index map or initialisation mode. Supported string values are
"zero"and"dirty". Default:"dirty".spec_max_update_count (int, optional) – Maximum number of spectral-index updates. Default: 50.
spec_max_update_interval (int, optional) – Maximum number of iterations between spectral-index updates. Default: 60.
spec_update_tol_max (float, optional) – Initial relative-variation threshold used to trigger a spectral-index update. Default: 1.6e-3.
spec_update_tol_min (float, optional) – Lower bound for the spectral-index update threshold. Default: 1e-5.
spec_update_tol_step (float, optional) – Multiplicative decay factor for the spectral-index update threshold. Default: 0.5.
verbose (bool, optional) – Enable informational logging. Default: True.
save_pth (str, optional) – Directory where optimiser products are saved. Default:
"results".file_prefix (str, optional) – Prefix prepended to saved file names. Default:
"".iter_save (int, optional) – Save interval for intermediate FITS products. Default: 1000.
Note
When
meas_op_approxis provided, the approximate operator is used in the iterative forward step whilemeas_opremains the reference operator for dirty-image, PSF, clean-beam, and heuristic calculations.- initialisation() None#
Initialise HyperAIRI-specific optimisation parameters.
This method sets the forward-backward step size, estimates channel-wise image peaks, computes heuristic noise levels, fits the clean beam used for spectral-index estimation, initialises the spectral-index map, and configures the HyperAIRI denoiser selector.
- _estimate_channel_wise_peak_val() None#
Estimate or set channel-wise image peak values.
When no user estimate is provided, this method uses the channel-wise maxima of the normalised dirty image.
- _fit_and_broadcast_clean_beam() None#
Fit and broadcast the clean beam used in spectral-index updates.
The clean beam is fitted from the PSF of the last global channel and stored in
self._clean_beamwith shape(1, 1, H, W). The last channel has the highest resolution.
- _initialise_spectral_index_map() None#
Initialise the spectral-index map.
The map is stored in
self._spec_idx_mapwith shape(1, 1, H, W). It can be supplied directly, estimated from the normalised dirty image, or initialised to zero.
- _each_iter_begin() None#
Run logic at the beginning of each iteration.
No per-iteration pre-processing is required for HyperAIRI.
- _stop_criteria() bool#
Evaluate the HyperAIRI stopping criterion.
- Returns:
Truewhen the minimum iteration count has been reached and the relative image variation falls below the stopping tolerance, otherwiseFalse.- Return type:
- _each_iter_end() None#
Run post-processing at the end of each iteration.
This method saves intermediate products, updates the HyperAIRI denoiser selection when enabled, and refreshes the spectral-index map according to the current relative-variation schedule.
- finalisation() None#
Finalise HyperAIRI and save the reconstructed products.
This method prints final log information, saves the reconstructed model and residual dirty images, and exports a spectral-index map estimated from the final image cube.
- _update_spec_idx_map() Tensor#
Update the spectral-index map from the current model image.
The update is computed by fitting a log-log linear model across the blurred channel images and frequencies on pixels with sufficient signal.
- Returns:
Updated spectral-index map with shape
(1, 1, H, W).- Return type: