corrct.solvers
Solvers for the tomographic reconstruction problem.
@author: Nicola VIGANÒ, Computational Imaging group, CWI, The Netherlands, and ESRF - The European Synchrotron, Grenoble, France
Module Contents
Classes
Reconstruction info. |
|
Initialize the base solver class. |
|
Implementation of the Filtered Back-Projection (FBP) algorithm. |
|
Solver class implementing the Simultaneous Algebraic Reconstruction Technique (SART) algorithm. |
|
Initialize the MLEM solver class. |
|
Initialize the SIRT solver class. |
|
Initialize the PDHG solver class. |
|
Fast Iterative Shrinkage-Thresholding Algorithm (FISTA). |
Functions
Compute the l2-norm of the operator A, with the power method. |
|
Compute diagonal scaling factors for the forward and backward projections. |
|
Compute Lipschitz scaling factors for the forward and backward projections. |
Data
API
- corrct.solvers.eps
None
- corrct.solvers.NDArrayFloat
None
- corrct.solvers.power_method(A: corrct.operators.BaseTransform, b: corrct.solvers.NDArrayFloat, iterations: int = 5) tuple[float, tuple[int, ...], numpy.typing.DTypeLike][source]
Compute the l2-norm of the operator A, with the power method.
Parameters
A : BaseTransform The forward operator whose l2-norm needs to be computed. b : NDArrayFloat The data vector (used only for shape and dtype). iterations : int, optional Number of power-method iterations. The default is 5.
Returns
Tuple[float, Tuple[int], DTypeLike] The l2-norm of A, and the shape and type of the solution.
- corrct.solvers.compute_diagonal_scaling(A_abs: corrct.operators.BaseTransform, At_abs: corrct.operators.BaseTransform, b: corrct.solvers.NDArrayFloat, regs: collections.abc.Sequence[corrct.regularizers.BaseRegularizer], relaxation_sigma: float = 1.0, relaxation_tau: float = 1.0, x_mask: numpy.typing.NDArray | None = None, b_mask: numpy.typing.NDArray | None = None) tuple[numpy.typing.NDArray, numpy.typing.NDArray, tuple[int, ...], numpy.typing.DTypeLike][source]
Compute diagonal scaling factors for the forward and backward projections.
Parameters
A_abs : operators.BaseTransform The absolute value of the forward projection operator. At_abs : operators.BaseTransform The absolute value of the backward projection operator. b : NDArrayFloat The measurement data. regs : Sequence[regularizers.BaseRegularizer] The sequence of regularizers. relaxation_sigma : float, optional The relaxation factor for the forward projection scaling, by default 1.0. relaxation_tau : float, optional The relaxation factor for the backward projection scaling, by default 1.0. x_mask : NDArray | None, optional The mask for the image space, by default None. b_mask : NDArray | None, optional The mask for the measurement space, by default None.
Returns
tuple[NDArray, NDArray, tuple[int, …], DTypeLike] The scaling factors for the forward and backward projections, the shape of the image space, and the data type of the image space.
- corrct.solvers.compute_Lipschitz_scaling(A: corrct.operators.BaseTransform, b: corrct.solvers.NDArrayFloat, regs: collections.abc.Sequence[corrct.regularizers.BaseRegularizer], relaxation_sigma: float = 1.0, relaxation_tau: float = 1.0) tuple[float, float | numpy.typing.NDArray, tuple[int, ...], numpy.typing.DTypeLike][source]
Compute Lipschitz scaling factors for the forward and backward projections.
Parameters
A : operators.BaseTransform The forward projection operator. b : NDArrayFloat The measurement data. regs : Sequence[regularizers.BaseRegularizer] The sequence of regularizers. relaxation_sigma : float, optional The relaxation factor for the forward projection scaling, by default 1.0. relaxation_tau : float, optional The relaxation factor for the backward projection scaling, by default 1.0.
Returns
tuple[float, float | NDArray, tuple[int, …], DTypeLike] The scaling factors for the forward and backward projections, the shape of the image space, and the data type of the image space.
- class corrct.solvers.SolutionInfo(method: str, max_iterations: int, tolerance: float | None, residual0_rec: float = np.inf, residual0_val: float = np.inf)[source]
Reconstruction info.
Initialization
- method: str
None
- iterations: int
None
- max_iterations: int
None
- residual0_rec: float
None
- residual0_val: float
None
- residuals_rec: corrct.solvers.NDArrayFloat
None
- residuals_val: corrct.solvers.NDArrayFloat
None
- tolerance: float | None
None
- best_residual_ind_rec: int
None
- best_residual_ind_val: int
None
- property residuals_rec_rel: corrct.solvers.NDArrayFloat
- property residuals_val_rel: corrct.solvers.NDArrayFloat
- class corrct.solvers.Solver(verbose: bool = False, leave_progress: bool = True, relaxation: float = 1.0, tolerance: float | None = None, data_term: str | corrct.data_terms.DataFidelityBase = 'l2', data_term_val: str | corrct.data_terms.DataFidelityBase | None = None, criterion: Literal[max_iter, loss_rec, loss_val] = 'max_iter')[source]
Bases:
abc.ABCInitialize the base solver class.
Parameters
verbose : bool, optional Turn on verbose output. The default is False. tolerance : float | None, optional Tolerance on the data residual for computing when to stop iterations. The default is None. relaxation : float, optional The relaxation length. The default is 1.0. data_term : str | data_terms.DataFidelityBase, optional Data fidelity term for computing the data residual. The default is “l2”. data_term_val : data_terms.DataFidelityBase | None, optional The data fidelity to be used for the validation set. If None, it will use the same as for the rest of the data. The default is None.
Initialization
- verbose: bool
None
- leave_progress: bool
None
- relaxation: float
None
- tolerance: float | None
None
- criterion: Literal[max_iter, loss_rec, loss_val]
None
- data_term: corrct.data_terms.DataFidelityBase
None
- data_term_val: corrct.data_terms.DataFidelityBase
None
- upper() str[source]
Return the upper case name of the solver.
Returns
str Upper case string name of the solver.
- lower() str[source]
Return the lower case name of the solver.
Returns
str Lower case string name of the solver.
- abstract __call__(A: corrct.operators.BaseTransform, b: corrct.solvers.NDArrayFloat, *args: Any, **kwds: Any) tuple[corrct.solvers.NDArrayFloat, corrct.solvers.SolutionInfo][source]
Execute the reconstruction of the data.
Parameters
A : operators.BaseTransform The projection operator. b : NDArrayFloat The data to be reconstructed.
Returns
Tuple[NDArrayFloat, SolutionInfo] The reconstruction and related information.
- static _initialize_data_fidelity_function(data_term: str | corrct.data_terms.DataFidelityBase) corrct.data_terms.DataFidelityBase[source]
- static _initialize_regularizer(regularizer: corrct.regularizers.BaseRegularizer | None | collections.abc.Sequence[corrct.regularizers.BaseRegularizer]) collections.abc.Sequence[corrct.regularizers.BaseRegularizer][source]
- static _initialize_b_masks(b: corrct.solvers.NDArrayFloat, b_mask: corrct.solvers.NDArrayFloat | None, b_val_mask: corrct.solvers.NDArrayFloat | None) tuple[corrct.solvers.NDArrayFloat | None, corrct.solvers.NDArrayFloat | None][source]
- _select_best_solution(info: corrct.solvers.SolutionInfo, curr_best_x: numpy.typing.NDArray, new_x: numpy.typing.NDArray) numpy.typing.NDArray[source]
- class corrct.solvers.FBP(verbose: bool = False, leave_progress: bool = False, regularizer: collections.abc.Sequence[corrct.regularizers.BaseRegularizer] | corrct.regularizers.BaseRegularizer | None = None, data_term: str | corrct.data_terms.DataFidelityBase = 'l2', fbp_filter: str | corrct.solvers.NDArrayFloat | corrct.filters.Filter = 'ramp', pad_mode: str = 'constant')[source]
Bases:
corrct.solvers.SolverImplementation of the Filtered Back-Projection (FBP) algorithm.
Initialization
Initialize the Filtered Back-Projection (FBP) algorithm.
Parameters
verbose : bool, optional Turn on verbose output. The default is False. leave_progress: bool, optional Leave the progress bar after the computation is finished. The default is True. regularizer : Sequence[regularizers.BaseRegularizer] | regularizers.BaseRegularizer | None, optional NOT USED, only exposed for compatibility reasons. data_term : str | data_terms.DataFidelityBase, optional NOT USED, only exposed for compatibility reasons. fbp_filter : str | NDArrayFloat | filters.Filter, optional FBP filter to use. Either a string from scikit-image’s list of
iradonfilters, or an array. The default is “ramp”. pad_mode: str, optional The padding mode to use for the linear convolution. The default is “constant”.- __call__(A: corrct.operators.BaseTransform, b: corrct.solvers.NDArrayFloat, iterations: int = 0, x0: corrct.solvers.NDArrayFloat | None = None, lower_limit: float | corrct.solvers.NDArrayFloat | None = None, upper_limit: float | corrct.solvers.NDArrayFloat | None = None, x_mask: corrct.solvers.NDArrayFloat | None = None, b_mask: corrct.solvers.NDArrayFloat | None = None) tuple[corrct.solvers.NDArrayFloat, corrct.solvers.SolutionInfo][source]
Reconstruct the data, using the FBP algorithm.
Parameters
A : BaseTransform Projection operator. b : NDArrayFloat Data to reconstruct. iterations : int Number of iterations. x0 : NDArrayFloat | None, optional Initial solution. The default is None. lower_limit : float | NDArrayFloat | None, optional Lower clipping value. The default is None. upper_limit : float | NDArrayFloat | None, optional Upper clipping value. The default is None. x_mask : NDArrayFloat | None, optional Solution mask. The default is None. b_mask : NDArrayFloat | None, optional Data mask. The default is None.
Raises
ValueError In case the data is 1D.
Returns
tuple[NDArrayFloat, SolutionInfo] The reconstruction, and None.
- class corrct.solvers.SART(verbose: bool = False, leave_progress: bool = True, relaxation: float = 1.0, tolerance: float | None = None, data_term: str | corrct.data_terms.DataFidelityBase = 'l2', data_term_val: str | corrct.data_terms.DataFidelityBase | None = None, criterion: Literal[max_iter, loss_rec, loss_val] = 'max_iter')[source]
Bases:
corrct.solvers.SolverSolver class implementing the Simultaneous Algebraic Reconstruction Technique (SART) algorithm.
Initialization
- compute_residual(A: collections.abc.Callable, b: corrct.solvers.NDArrayFloat, x: corrct.solvers.NDArrayFloat, A_num_rows: int, b_mask: corrct.solvers.NDArrayFloat | None) corrct.solvers.NDArrayFloat[source]
Compute the solution residual.
Parameters
A : Callable The forward projector. b : NDArrayFloat The detector data. x : NDArrayFloat The current solution A_num_rows : int The number of projections. b_mask : NDArrayFloat | None The mask to apply
Returns
NDArrayFloat The residual.
- __call__(A: collections.abc.Callable[[numpy.typing.NDArray, int], numpy.typing.NDArray] | corrct.projectors.ProjectorUncorrected, b: corrct.solvers.NDArrayFloat, iterations: int, A_num_rows: int | None = None, At: collections.abc.Callable | None = None, x0: corrct.solvers.NDArrayFloat | None = None, lower_limit: float | corrct.solvers.NDArrayFloat | None = None, upper_limit: float | corrct.solvers.NDArrayFloat | None = None, x_mask: corrct.solvers.NDArrayFloat | None = None, b_mask: corrct.solvers.NDArrayFloat | None = None) tuple[corrct.solvers.NDArrayFloat, corrct.solvers.SolutionInfo][source]
Reconstruct the data, using the SART algorithm.
Parameters
A : Callable[[NDArray, int], NDArray] | projectors.ProjectorUncorrected Projection operator. b : NDArrayFloat Data to reconstruct. iterations : int Number of iterations. A_num_rows : int | None Number of projections. x0 : NDArrayFloat | None, optional Initial solution. The default is None. At : Callable | None, optional The back-projection operator. This is only needed if the projection operator does not have an adjoint. The default is None. lower_limit : float | NDArrayFloat | None, optional Lower clipping value. The default is None. upper_limit : float | NDArrayFloat | None, optional Upper clipping value. The default is None. x_mask : NDArrayFloat | None, optional Solution mask. The default is None. b_mask : NDArrayFloat | None, optional Data mask. The default is None.
Returns
tuple[NDArrayFloat, SolutionInfo] The reconstruction, and the residuals.
- class corrct.solvers.MLEM(verbose: bool = False, leave_progress: bool = True, tolerance: float | None = None, regularizer: collections.abc.Sequence[corrct.regularizers.BaseRegularizer] | corrct.regularizers.BaseRegularizer | None = None, data_term: str | corrct.data_terms.DataFidelityBase = 'kl', data_term_val: str | corrct.data_terms.DataFidelityBase | None = None, criterion: Literal[max_iter, loss_rec, loss_val] = 'max_iter')[source]
Bases:
corrct.solvers.SolverInitialize the MLEM solver class.
This class implements the Maximum Likelihood Expectation Maximization (MLEM) algorithm.
Parameters
verbose : bool, optional Turn on verbose output. The default is False. leave_progress: bool, optional Leave the progress bar after the computation is finished. The default is True. tolerance : float | None, optional Tolerance on the data residual for computing when to stop iterations. The default is None. regularizer : Sequence[regularizers.BaseRegularizer] | regularizers.BaseRegularizer | None, optional Regularizer to be used. The default is None. data_term : str | data_terms.DataFidelityBase, optional Data fidelity term for computing the data residual. The default is “l2”. data_term_val : data_terms.DataFidelityBase | None, optional The data fidelity to be used for the validation set. If None, it will use the same as for the rest of the data. The default is None.
Initialization
- __call__(A: corrct.operators.BaseTransform, b: corrct.solvers.NDArrayFloat, iterations: int, x0: corrct.solvers.NDArrayFloat | None = None, lower_limit: float | corrct.solvers.NDArrayFloat | None = None, upper_limit: float | corrct.solvers.NDArrayFloat | None = None, x_mask: corrct.solvers.NDArrayFloat | None = None, b_mask: corrct.solvers.NDArrayFloat | None = None, b_val_mask: corrct.solvers.NDArrayFloat | None = None) tuple[corrct.solvers.NDArrayFloat, corrct.solvers.SolutionInfo][source]
Reconstruct the data, using the MLEM algorithm.
Parameters
A : BaseTransform Projection operator. b : NDArrayFloat Data to reconstruct. iterations : int Number of iterations. x0 : NDArrayFloat | None, optional Initial solution. The default is None. lower_limit : float | NDArrayFloat | None, optional Lower clipping value. The default is None. upper_limit : float | NDArrayFloat | None, optional Upper clipping value. The default is None. x_mask : NDArrayFloat | None, optional Solution mask. The default is None. b_mask : NDArrayFloat | None, optional Data mask. The default is None. b_val_mask : NDArrayFloat | None, optional Validation data mask. The default is None.
Returns
tuple[NDArrayFloat, SolutionInfo] The reconstruction, and the residuals.
- class corrct.solvers.SIRT(verbose: bool = False, leave_progress: bool = True, relaxation: float = 1.95, tolerance: float | None = None, regularizer: collections.abc.Sequence[corrct.regularizers.BaseRegularizer] | corrct.regularizers.BaseRegularizer | None = None, data_term: str | corrct.data_terms.DataFidelityBase = 'l2', data_term_val: str | corrct.data_terms.DataFidelityBase | None = None, criterion: Literal[max_iter, loss_rec, loss_val] = 'max_iter')[source]
Bases:
corrct.solvers.SolverInitialize the SIRT solver class.
This class implements the Simultaneous Iterative Reconstruction Technique (SIRT) algorithm.
Parameters
verbose : bool, optional Turn on verbose output. The default is False. leave_progress: bool, optional Leave the progress bar after the computation is finished. The default is True. tolerance : float | None, optional Tolerance on the data residual for computing when to stop iterations. The default is None. relaxation : float, optional The relaxation length. The default is 1.95. regularizer : Sequence[regularizers.BaseRegularizer] | regularizers.BaseRegularizer | None, optional Regularizer to be used. The default is None. data_term : str | data_terms.DataFidelityBase, optional Data fidelity term for computing the data residual. The default is “l2”. data_term_val : data_terms.DataFidelityBase | None, optional The data fidelity to be used for the validation set. If None, it will use the same as for the rest of the data. The default is None.
Initialization
- __call__(A: corrct.operators.BaseTransform, b: corrct.solvers.NDArrayFloat, iterations: int, x0: corrct.solvers.NDArrayFloat | None = None, lower_limit: float | corrct.solvers.NDArrayFloat | None = None, upper_limit: float | corrct.solvers.NDArrayFloat | None = None, x_mask: corrct.solvers.NDArrayFloat | None = None, b_mask: corrct.solvers.NDArrayFloat | None = None, b_val_mask: corrct.solvers.NDArrayFloat | None = None) tuple[corrct.solvers.NDArrayFloat, corrct.solvers.SolutionInfo][source]
Reconstruct the data, using the SIRT algorithm.
Parameters
A : BaseTransform Projection operator. b : NDArrayFloat Data to reconstruct. iterations : int Number of iterations. x0 : NDArrayFloat | None, optional Initial solution. The default is None. lower_limit : float | NDArrayFloat | None, optional Lower clipping value. The default is None. upper_limit : float | NDArrayFloat | None, optional Upper clipping value. The default is None. x_mask : NDArrayFloat | None, optional Solution mask. The default is None. b_mask : NDArrayFloat | None, optional Data mask. The default is None. b_val_mask : NDArrayFloat | None, optional Validation data mask. The default is None.
Returns
tuple[NDArrayFloat, SolutionInfo] The reconstruction, and the residuals.
- class corrct.solvers.PDHG(verbose: bool = False, leave_progress: bool = True, tolerance: float | None = None, relaxation: float = 0.95, regularizer: collections.abc.Sequence[corrct.regularizers.BaseRegularizer] | corrct.regularizers.BaseRegularizer | None = None, data_term: str | corrct.data_terms.DataFidelityBase = 'l2', data_term_val: str | corrct.data_terms.DataFidelityBase | None = None, criterion: Literal[max_iter, loss_rec, loss_val] = 'max_iter')[source]
Bases:
corrct.solvers.SolverInitialize the PDHG solver class.
PDHG stands for primal-dual hybrid gradient algorithm from Chambolle and Pock.
Parameters
verbose : bool, optional Turn on verbose output. The default is False. leave_progress: bool, optional Leave the progress bar after the computation is finished. The default is True. tolerance : float | None, optional Tolerance on the data residual for computing when to stop iterations. The default is None. relaxation : float, optional The relaxation length. The default is 0.95. regularizer : Sequence[regularizers.BaseRegularizer] | regularizers.BaseRegularizer | None, optional Regularizer to be used. The default is None. data_term : str | data_terms.DataFidelityBase, optional Data fidelity term for computing the data residual. The default is “l2”. data_term_val : data_terms.DataFidelityBase | None, optional The data fidelity to be used for the validation set. If None, it will use the same as for the rest of the data. The default is None.
Initialization
- static _initialize_data_fidelity_function(data_term: str | corrct.data_terms.DataFidelityBase)[source]
- __call__(A: corrct.operators.BaseTransform, b: corrct.solvers.NDArrayFloat, iterations: int, x0: corrct.solvers.NDArrayFloat | None = None, lower_limit: float | corrct.solvers.NDArrayFloat | None = None, upper_limit: float | corrct.solvers.NDArrayFloat | None = None, x_mask: corrct.solvers.NDArrayFloat | None = None, b_mask: corrct.solvers.NDArrayFloat | None = None, b_val_mask: corrct.solvers.NDArrayFloat | None = None, precondition: bool = True) tuple[corrct.solvers.NDArrayFloat, corrct.solvers.SolutionInfo][source]
Reconstruct the data, using the PDHG algorithm.
Parameters
A : BaseTransform Projection operator. b : NDArrayFloat Data to reconstruct. iterations : int Number of iterations. x0 : NDArrayFloat | None, optional Initial solution. The default is None. lower_limit : float | NDArrayFloat | None, optional Lower clipping value. The default is None. upper_limit : float | NDArrayFloat | None, optional Upper clipping value. The default is None. x_mask : NDArrayFloat | None, optional Solution mask. The default is None. b_mask : NDArrayFloat | None, optional Data mask. The default is None. b_val_mask : NDArrayFloat | None, optional Validation data mask. The default is None. precondition : bool, optional Whether to use the preconditioned version of the algorithm. The default is True.
Returns
tuple[NDArrayFloat, SolutionInfo] The reconstruction, and the residuals.
- class corrct.solvers.FISTA(verbose: bool = False, leave_progress: bool = True, tolerance: float | None = None, relaxation: float = 1.0, regularizer: corrct.regularizers.BaseRegularizer | None = None, data_term: str | corrct.data_terms.DataFidelityBase = 'l2', data_term_val: str | corrct.data_terms.DataFidelityBase | None = None, criterion: Literal[max_iter, loss_rec, loss_val] = 'max_iter', restart_period: int | None = None)[source]
Bases:
corrct.solvers.SolverFast Iterative Shrinkage-Thresholding Algorithm (FISTA).
Implements the accelerated proximal gradient method from Beck & Teboulle (2009), “A Fast Iterative Shrinkage-Thresholding Algorithm for Linear Inverse Problems”, SIAM Journal on Imaging Sciences.
The algorithm minimizes: min_x f(x) + g(x)
where:
f(x) is the data-fidelity term, handled via its gradient: grad f(x) = A^T (A x - b) for the l2 case grad f(x) = A^T (1 - b / Ax) for the KL case (computed using
data_term.compute_residualfollowed byA.T).g(x) is an optional regularizer with a tractable primal proximal, applied via
regularizer.apply_proximal_primal.
TV-min regularization (Regularizer_Grad and all TV subclasses) is not supported because their primal proximal has no closed form. Passing such a regularizer raises
ValueErrorat construction time.At most one regularizer is accepted; passing a list with more than one raises
ValueError.Step-size strategy
Two modes are available, selected by the
preconditionargument to__call__:precondition=False(default Lipschitz): the step size istau = relaxation / LwhereL = ||A||^2is estimated via the power method.precondition=True(SIRT-style diagonal preconditioning): following the same convention as SIRT,Sigma = diag(|A| 1_x) (column sums of |A|, in measurement space) Tau = diag(|A^T| 1_b) (row sums of |A|, in image space)
The gradient step then reads: x <- x - Tau * A^T(residual * Sigma)
where
residual = b - A x. This is the SIRT preconditioned gradient step; therelaxationscalar is folded into Tau asTau = relaxation / Tau_raw.
Parameters
verbose : bool, optional Turn on verbose output. The default is False. leave_progress : bool, optional Leave the progress bar after computation. The default is True. tolerance : float | None, optional Stop early when the residual norm drops below this value. The default is None. relaxation : float, optional Step-size relaxation factor (scalar multiplier on tau). The default is 1.0. regularizer : BaseRegularizer | None, optional A single regularizer with a tractable primal proximal. TV-type and Laplacian regularizers are rejected. The default is None. data_term : str | DataFidelityBase, optional Data fidelity. Accepts
"l2"or aDataFidelity_l2instance. The default is"l2". data_term_val : DataFidelityBase | None, optional Data fidelity for the held-out validation set. Defaults to the same asdata_term. restart_period : int | None, optional If given, the FISTA momentum sequence is restarted everyrestart_perioditerations. IfNone(default), the pure Beck-Teboulle monotone sequence is used with no restart.Initialization
- static _initialize_data_fidelity_function(data_term: str | corrct.data_terms.DataFidelityBase)[source]
Accept l2, wl2, l2b and their subclasses for FISTA.
- __call__(A: corrct.operators.BaseTransform, b: corrct.solvers.NDArrayFloat, iterations: int, x0: corrct.solvers.NDArrayFloat | None = None, lower_limit: float | corrct.solvers.NDArrayFloat | None = None, upper_limit: float | corrct.solvers.NDArrayFloat | None = None, x_mask: corrct.solvers.NDArrayFloat | None = None, b_mask: corrct.solvers.NDArrayFloat | None = None, b_val_mask: corrct.solvers.NDArrayFloat | None = None, precondition: bool = True) tuple[corrct.solvers.NDArrayFloat, corrct.solvers.SolutionInfo][source]
Run FISTA.
Parameters
A : BaseTransform Forward operator. b : NDArrayFloat Measurement data. iterations : int Number of outer iterations. x0 : NDArrayFloat | None, optional Warm-start solution. The default is None (zero initialisation). lower_limit : float | NDArrayFloat | None, optional Hard lower bound applied after each proximal step (clipping). The default is None. upper_limit : float | NDArrayFloat | None, optional Hard upper bound applied after each proximal step (clipping). The default is None. x_mask : NDArrayFloat | None, optional Binary solution mask. The default is None. b_mask : NDArrayFloat | None, optional Binary data mask. The default is None. b_val_mask : NDArrayFloat | None, optional Held-out validation set mask. The default is None. precondition : bool, optional If
True(default), use SIRT-style diagonal preconditioning. IfFalse, usetau = relaxation / LwhereLis estimated by the power method.Returns
tuple[NDArrayFloat, SolutionInfo] The reconstruction and associated iteration info.