# Unfolded Algorithms for Deep Phase Retrieval
## 3 UPR: The Proposed Framework
### Architecture of the Decoding Module
The first stage is concerned with a sparse orthogonality-promoting initialization and employs iterations based on truncated gradients. Specifically, the initialization utilizes power iterations on the estimated support of the sparse signal. The second stage then makes use of truncated gradients for thresholding iterations, except for \(s\) signal elements with the largest magnitudes. Starting from an initial guess (\(\mathbf{z}_{0}\)), the SPARTA algorithm is tasked with approximating the solution to (19) in an iterative manner via update equations as follows:  
\[\min_{\mathbf{z}\in\mathbb{C}^{n}}\quad\ell(\mathbf{z})\quad\text{s.t.}\quad\mathbf{z}\in \Omega, \tag{10}\]1  
where the above iterations can be viewed as performing the gradient descent algorithm with a per-iteration step size of \(\alpha\) on the truncated loss function objective (\(\ell_{\text{tr}}\)), whose gradient is defined as follows:  
\[\min_{\mathbf{z}\in\mathbb{C}^{n}}\quad\ell(\mathbf{z})\quad\text{s.t.}\quad\mathbf{z}\in \Omega, \tag{10}\]2  
where \(\mathcal{I}_{l+1}=\{1\leq i\leq m||\mathbf{a}_{i}^{T}\mathbf{z}^{l}|\geq|\mathcal{E}_{ A}(\mathbf{x})|_{i}/(1+\tau)\}\), \(\tau\) represents the truncation threshold determined by the sparsity of the system (with a value of 0.7 shown to facilitate exact recovery in Theorem 1 of [20]), and \(\mathcal{J}_{s}(\mathbf{z}):\mathbb{R}^{m}\mapsto\mathbb{R}^{m}\) sets all entries of \(\mathbf{u}\) to zero except for the \(s\) entries with the largest magnitudes. Moreover, \(\mathcal{S}\) is the support vector for \(\mathbf{x}\) in SPARTA, \(\mathcal{S}\subseteq[n]:=\{1,...,n\}\) with \(|\mathcal{S}|=k<<n\), and the estimated support (\(\mathcal{S}\)) is set to include indices from the \(k\) largest instances in \(\{\sum_{i=1}^{m}y_{i}^{2}|a_{i,j}|^{2}/m\}_{j=1}^{n}\). In particular, \(\mathbf{z}^{0}\) is initialized as \(\sqrt{\sum_{i=1}^{m}[\mathcal{E}_{A}(\mathbf{x})]_{i}^{2}/m}\mathbf{z}^{0}\), where \(\mathbf{z}^{0}\in\mathbb{R}^{n}\) is created by placing zeros in \(\mathbf{z}_{\mathcal{S}}^{0}\) where the indices are not in \(\mathcal{S}\). The principal eigenvector (\(\mathbf{\hat{z}}_{\mathcal{S}}^{0}\in\mathbb{R}^{s}\)) is determined by performing power-method iterations on the matrix:  
\[\min_{\mathbf{z}\in\mathbb{C}^{n}}\quad\ell(\mathbf{z})\quad\text{s.t.}\quad\mathbf{z}\in \Omega, \tag{10}\]3  
With the structure of the iterations of SPARTA provided in (20) and the structure provided in (13) in mind, we can now easily derive the corresponding deep architecture by introducing a preconditioning matrix (\(\mathbf{G}^{i}\)) at each iteration in lieu of \(\alpha\) and cast it as a trainable parameter. Ergo, UPR-SPARTA can be presented via the mathematical structure of the UPR architecture proposed in the previous part, as we define the computational dynamics of the \(l\)-th layer of the UPR-SPARTA architecture according to (14). Furthermore,the dynamics of the overall network with \(L\) layers are the same as (15), and the primary trainable parameters for the proposed decoder module become \(\mathbf{\Gamma}=\{\mathbf{G}_{0},\mathbf{G}_{1},\cdots,\mathbf{G}_{L-1}\}\), as described in the previous section. For the sake of completeness, the inner computation dynamics of UPR-SPARTA are summarized below:  
**UPR-SPARTA Computation Dynamics:**  
Initialize \(\mathbf{z}_{0}\) according to the discussion above (22). Every layer (\(i\in\{0,1,\ldots,L-1\}\)) is tuned to compute the following:  
\[\min_{\mathbf{z}\in\mathbb{C}^{n}}\quad\ell(\mathbf{z})\quad\text{s.t.}\quad\mathbf{z}\in \Omega, \tag{10}\]4  
and  
\[\min_{\mathbf{z}\in\mathbb{C}^{n}}\quad\ell(\mathbf{z})\quad\text{s.t.}\quad\mathbf{z}\in \Omega, \tag{10}\]5  
where \(\mathbf{z}\) is the input to the \(l\)-th layer and \(\gamma_{i}=\{\mathbf{G}_{i}\in\mathbb{S}_{+}\}\).