spectral_methods#
- deepinv.optim.phase_retrieval.spectral_methods(y, physics, x=None, n_iter=50, preprocessing=default_preprocessing, lamb=10.0, x_true=None, log=False, log_metric=cosine_similarity, early_stop=True, rtol=1e-5, verbose=False)[source]#
Utility function for spectral methods.
This function runs the Spectral Methods algorithm to find the principal eigenvector of the regularized weighted covariance matrix:
\[\begin{equation*} M = \conj{B} \text{diag}(T(y)) B + \lambda I, \end{equation*}\]where \(B\) is the linear operator of the phase retrieval class, \(T(\cdot)\) is a preprocessing function for the measurements, and \(I\) is the identity matrix of corresponding dimensions. Parameter \(\lambda\) tunes the strength of regularization.
To find the principal eigenvector, the function runs power iteration which is given by
\[\begin{split}\begin{equation*} \begin{aligned} x_{k+1} &= M x_k \\ x_{k+1} &= \frac{x_{k+1}}{\|x_{k+1}\|}, \end{aligned} \end{equation*}\end{split}\]- Parameters:
y (torch.Tensor) – Measurements.
physics (deepinv.physics.Physics) – Instance of the physics modeling the forward matrix.
x (torch.Tensor) – Initial guess for the signals \(x_0\).
n_iter (int) – Number of iterations.
preprocessing (Callable) – Function to preprocess the measurements. Default is \(\max(1 - 1/x, -5)\).
lamb (float) – Regularization parameter. Default is 10.
log (bool) – Whether to log the metrics. Default is False.
log_metric (Callable) – Metric to log. Default is cosine similarity.
early_stop (bool) – Whether to early stop the iterations. Default is True.
rtol (float) – Relative tolerance for early stopping. Default is 1e-5.
verbose (bool) – If True, prints information in case of an early stop. Default is False.
- Returns:
The estimated signals \(x\).
Examples using spectral_methods
:#
Random phase retrieval and reconstruction methods.