# Unfolded Algorithms for Deep Phase Retrieval
## 4 Numerical Results and Discussion
### Performance of the Proposed UPR-IRWF
We see how an over 41% improvement in the number of layers/iterations for both scenarios underscores the impact of fewer trainable parameters and joint optimization. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \((n,m)=(100,600)\) & \((n,m)=(300,300)\) \\ \hline
**IRWF** & **UPR-IRWF** & **SPARTA** & **UPR-SPARTA** \\ \hline Layers/Iterations & 35 & 23 & 17 & 11 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Layers/iterations required to achieve consistent successful recovery for each algorithm. Figure 4: Empirical success rate versus the measurement-to-signal length ratio \((m/n)\) for \(\mathbf{x}\in\mathds{R}^{n}\) with \(n=100\). In the following, we evaluate the performance of the proposed UPR-IRWF algorithm on the real-world MNIST handwritten digit dataset [57]. In particular, we consider the following training scenarios:  
1. Training Scenario 1: We consider the training of the UPR-IRWF architecture on the MNIST dataset with 2048 training samples, with a testing dataset of 4096 samples. 2. Training Scenario 2: We consider the training of the UPR-IRWF architecture on random Gaussian vectors and evaluate the performance of the proposed method on the MNIST testing dataset comprising 4096 samples. Training Scenario 1 is chosen to demonstrate the ability of the proposed methodology in capturing the statistical properties of non-Gaussian data points, while Training Scenario 2 is chosen to demonstrate the generalization ability of the proposed architecture when the network is tested on out-of-distribution samples. Furthermore, for comparison purposes, we consider testing the underlying IRWF algorithm on the same testing dataset as in the first scenario. Moreover, to demonstrate the superiority of the proposed hybrid methodology in comparison to generic black-box neural networks, we consider substituting the decoder function with a multi-layer fully connected neural network (FCN) with the following computational dynamics:  
\[\mathcal{G}_{\Gamma}^{\text{FCN}}(\mathbf{x})=\mathbf{W}_{3}\sigma(\mathbf{W}_{2}\sigma( \mathbf{W}_{1}\mathbf{x})), \tag{33}\]  
where \(\Gamma=\{\mathbf{W}_{1}\in\mathbb{R}^{m\times n},\mathbf{W}_{2}\in\mathbb{R}^{m\times m },\mathbf{W}_{3}\in\mathbb{R}^{n\times m}\}\) denotes the set of trainable parameters of the FCN and \(\sigma(\cdot)\) represents the Rectified Linear Unit (ReLU) activation function. We consider the training and testing procedure of the FCN architecture in the same manner as in Training Scenario 1 defined above. Furthermore, we consider the equivalent vectorized representation of the data points in the handwritten digit dataset as \(\mathbf{x}\in\mathbb{R}^{n}\), where \(n=784\) (the original data points are \(28\times 28\) matrices). Figure 6 represents the performance of the proposed methodology and the competing algorithm for the abovementioned scenarios. Observing Figure 6, one can deduce that  
Figure 5: Convergence behavior of the proposed UPR-IRWF as compared to the original IRWF algorithm for the case of \(\mathbf{x}\in\mathbb{R}^{n}\), with \((n,m)=(100,600)\). the proposed UPR-IRWF under Training Scenario 1 significantly outperforms the baseline IRWF algorithm. Furthermore, it can be observed that the FCN totally fails to reconstruct the underlying signal of interest along all sampling ratios. Surprisingly, the performance of the UPR-IRWF methodology under Training Scenario 2, where the network is trained on random Gaussian vectors and tested on the MNIST dataset, indicates great generalizability performance, while it still maintains its superior performance compared to the underlying IRWF algorithm. This is in contrast to black-box, data-driven methodologies, where the performance of such architectures significantly deteriorates once the network is exposed to out-of-distribution samples. The great generalizability performance of the proposed methodology is presumably due to its model-based roots.