# Unfolded Algorithms for Deep Phase Retrieval
## 2 System Model and Problem Formulation
The design of a phase retrieval system in such a joint and end-to-end manner results in a task-specific and data-driven data-acquisition system, along with a signal reconstruction algorithm for which the encoder module can then be deployed in the physical system, while the decoder module can be used as an stand-alone algorithm for the task of signal reconstruction. In order to make the joint design possible, we seek to identify sensing matrices that make the recovery of the underlying signal of interest feasible and to identify structures that are amenable to a specific class of reconstruction algorithms and vice versa. Let \(\mathcal{D}_{\Phi}:\mathbb{R}^{n}\mapsto\mathbb{C}^{m}\) denote the class of decoder functions parameterized on a set of parameters (\(\Phi\)). Further assume that for a given measurement matrix (\(\mathbf{A}\)) and the corresponding measurements vector (\(\mathbf{y}\)), \(\mathbf{\hat{x}}\) represents an estimation of the signal of interest provided by a certain characterization of the decoder function, viz., \(\mathbf{\hat{x}}=\mathcal{D}_{\phi}(\mathbf{y};\mathbf{A})\), where \(\phi\in\Phi\) denotes a characterization of the decoder module from the original class. Recall that for a fixed sensing matrix (\(\mathbf{A}\)), the dynamics of the data-acquisition model of a phase retrieval system are given by \(\mathbf{y}=|\mathbf{Ax}|\). Accordingly, for a fixed characterization of the decoder function (\(\mathcal{D}_{\phi\in\Phi}\)), the design of the sensing matrix (\(\mathbf{A}\in\mathbb{C}^{m\times n}\)) can be considered according to the following optimization problem:  
\[\min_{\mathbf{A}\in\mathbb{C}^{m\times n}}\ \ \mathrm{E}_{\mathbf{x}\sim P(\mathbf{x})}\big{\{} \mathrm{D}\big{(}\mathbf{x},\mathcal{D}_{\phi}(|\mathbf{A}\mathbf{x}|;\mathbf{A})\big{)}\big{\}}, \tag{4}\]  
where \(P(\mathbf{x})\) represents the distribution of the underlying signal of interest. For simplicity, we drop the \(\mathbf{x}\sim P(\mathbf{x})\) notation, and unless mentioned otherwise, all expectations are taken with respect to the input distribution in the sequel. The aforementioned approach for the design of the sensing matrix considers the signal reconstruction accuracy as a design criterion with respect to a particular realization of the decoder functions. Thus, the obtained matrix (\(\mathbf{A}\)) can be viewed as a task-specific encoding matrix that not only considers the underlying distribution of the signal but also the considered class of decoder functions, resulting in superior performance. Once a solution to (4) is obtained, the sensing matrix can be utilized for data-acquisition purposes, while the fixed decoder module \(\mathcal{D}_{\phi}\) can be used to carry out the reconstruction of the signal of interest. However, starting our design from (4) presents us with an inherent performance bottleneck. Namely, although the sensing matrix is designed to increase the accuracy of the decoder module, the overall performance of the system is still limited to the ability of the decoder function to obtain an accurate estimation (\(\mathbf{\hat{x}}\)). For instance, to see why, let \(\mathcal{D}_{\phi_{1}\in\Phi}\) and \(\mathcal{D}_{\phi_{2}\in\Phi}\) represent two realizations of the decoder module from the same class, and let \(\mathbf{A}\) denote a fixed sensing matrix that is the solution to (4) for \(\phi=\phi_{2}\). Then, for a signal of interest (\(\mathbf{x}\sim P(\mathbf{x})\)) and the corresponding phase-less measurements (\(\mathbf{y}\)), it might be the case that  
\[\mathds{E}\big{\{}\mathrm{D}(\mathbf{x},\mathcal{D}_{\phi_{1}}(\mathbf{y};\mathbf{A})) \big{\}}\leq\mathds{E}\big{\{}\mathrm{D}(\mathbf{x},\mathcal{D}_{\phi_{2}}(\mathbf{y} ;\mathbf{A}))\big{\}}. \tag{5}\]  
In other words, the realization of the decoder module on the set of parameters (\(\phi_{1}\in\Phi\)) results in a more accurate reconstruction algorithm as compared to the alternative realization. As a result, it is better to consider the design of the sensing matrix with respect to \(\mathcal{D}_{\phi_{1}}\) in such a case.