# Machine-Learning-Based Optimization for Multiple-IRS-Aided Communication System
## 2 System Model
### Formulation and Analysis of the Optimization Problem  
The focus of this work is to minimize the total power transmitted by the BS through jointly optimizing the active transmit beamforming matrix, \(\mathbf{W}\), and passive beamforming matrices, \(\{\mathbf{\Theta}_{l}\}_{l=1}^{L}\), subject to users' SINR constraints, which is formulated as follows.  
\[P1:\min_{W,\{\mathbf{\Theta}_{l}\}_{l=1}^{L}} \sum_{k=1}^{K}\|\mathbf{w}_{k}\|^{2}\] (8a) s.t. \[SINR_{k}\geq\gamma_{k},\,\forall l,k, \tag{8b}\] \[0\leq\theta_{l,n}\leq 2\pi,\,\forall l,n, \tag{8c}\]  
where \(\mathbf{W}=\{\mathbf{w}_{1},\dots\mathbf{w}_{K}\}\mathbb{C}^{M\times K},\{\mathbf{\Theta}_{l} \}_{l=1}^{L}=\{\mathbf{\Theta}_{1},\mathbf{\Theta}_{l},\dots,\mathbf{\Theta}_{L}\}\), and \(\gamma_{k}\) is the SINR threshold of the \(k\)-th UE. The problem is non-convex due to the coupling in the UEs' SINR constraints (8b) between the optimization variables.  
One conventional method for solving the above problem is the alternating optimization approach, as in [5; 14]. Generally, the AO separates the main problem into two sub-problems, i.e., one for fixed IRSs' beamforming and another for fixed BS beamforming, iteratively optimizing the solutions until convergence is met. Specifically, by initializing the phases of all IRS matrices, \(\{\mathbf{\Theta}_{l}\}_{l=1}^{L}\), to \((P1)\), the corresponding BS beamforming, \(\mathbf{W}\), can be found by solving the following sub-problem \((P2)\):  
\[P2:\min_{\mathbf{W}} \sum_{k=1}^{K}\|\mathbf{w}_{k}\|^{2}\] (9a) s.t. \[\frac{\left|\mathbf{h}_{\text{rk}}^{H}\mathbf{w}_{k}\right|^{2}}{\sum_{j \
eq k}\left|\mathbf{h}_{\text{rk}}^{H}\mathbf{w}_{j}\right|^{2}+\sigma_{k}^{2}}\geq \gamma_{k},\forall l,k, \tag{9b}\]  
where \(\mathbf{h}_{\text{k}}^{H}=\sum_{l\in\mathcal{L}}\mathbf{h}_{\text{rk}}^{H}\mathbf{\Theta} _{l}\,\,\mathbf{G}_{l}+\mathbf{h}_{\text{dk}}^{H}\) is the total calculated channel coefficient between the source BS and the \(k\)-th UE in the system. The second-order cone program (SOCP) [31] can be used to solve this convex problem.  
On the other hand, after optimizing the BS beamforming matrix, \(\mathbf{W}\), the IRSs' reflection phase matrices are optimized using the following reduced feasibility check problem \((P3)\):  
\[P3:\text{Find} \{\mathbf{\Theta}_{l}\}_{l=1}^{L}\] (10a) s.t. \[\frac{\left|(\sum_{l\in\mathcal{L}}\mathbf{h}_{\text{rk}}^{H}\mathbf{ \Theta}_{l}\,\,\mathbf{G}_{l}+\mathbf{h}_{\text{dk}}^{H})\mathbf{w}_{k}\right|^{2}}{\sum_{ j\
eq k}\left|(\sum_{l\in\mathcal{L}}\mathbf{h}_{\text{rk}}^{H}\mathbf{\Theta}_{l} \,\,\mathbf{G}_{l}+\mathbf{h}_{\text{dk}}^{H})\mathbf{w}_{j}\right|^{2}+\sigma_{k}^{2}} \geq\gamma_{k},\forall l,k, \tag{10b}\] \[0\leq\theta_{l,n}\leq 2\pi,\,\,\forall l,n. \tag{10c}\]  
It is possible to relax this problem to a convex SDP feasibility check problem, which can then be solved by the efficient convex solver (CVX) [32], or improve the converged level by transforming it into an optimization problem with an objective function [5; 14].  
However, the iterative process of AO is time-consuming as it needs to solve many sub-optimization problems until reaching a defined acceptable level of convergence, which makes it impractical in a highly dynamic environment with a mobility case of UEs. Motivated by these aspects, we develop machine-learning-based algorithms for the online implementation of the active and passive beamforming by considering the static UE scenario and the dynamic UE scenario in the following sections.