# Recurrent Deep Learning for Beam Pattern Synthesis in Optimized Antenna Arrays
## 3 Numerical Experiments
### Deep Neural Network Results  
Subsequently, we employed an FCNN, a 1D-CNN, and a LSTM deep neural network to predict the amplitudes and phases of the radiation patterns. The loss function utilized was the MSE, which was used to compute the error. Furthermore, the Adam optimizer algorithm was employed for training the networks, which leverages previous gradient information and accelerates convergence [30], with a learning rate of 0.001 for 400 epochs and with mini-batches of 32 radiation patterns. Table 1 shows the MAE and MSE values achieved by the three proposed architecture. The LSTM outperformed the FCNN and 1D-CNN due to its ability to selectively retain or forget information based on the context and relevance of the radiation patterns. This enables the LSTM to effectively capture long-term dependencies in sequential data, making them well-suited for natural language processing, speech recognition, and time-series analysis. On average, training with the LSTM took 7.991 min, while testing took 0.072 s for the 92 test patterns. The whole set of experiments in this paper was executed using a workstation with an Intel(R) Xeon(R) CPU @ 2.00 GHz processor with 64 GB of RAM (ASUS, Leon, Mexico), as well as an Nvidia RTX 3090 graphical processing unit (Nvidia, Leon, Mexico). In terms of neural networks, Figure 4 illustrates that, as the training epochs progressed, the LSTM network increasingly improved its approximation of the radiation patterns to match their respective labels, including both magnitudes and phases. This process resulted in progressively smaller errors over time, with the network ultimately converging at epoch 400 for the MSE (4) and MAE (3) metrics. On the other hand, in terms of beam pattern synthesis, the achieved errors represent the network's capability to meet essential design requirements. During the pre-synthesis or pre-conditioning phase, we used a genetic algorithm (GA) to ensure that the synthesized patterns aligned with key antenna specifications set by the fitness function, focusing on high directivity and controlled sidelobe levels. This GA-based pre-conditioning produced training data that meet the baseline performance thresholds, allowing the LSTM network to learn not only to approximate target radiation patterns but also to capture the specific characteristics necessary for practical beamforming. As such, the decreasing mean squared error (MSE) and mean absolute error (MAE) values shown in Figure 4 reflect the network's convergence toward patterns that satisfy these specifications, ensuring that the final loss values are appropriate for antenna beam pattern synthesis. \begin{table}
\begin{tabular}{l c c c c} \hline \hline \multirow{2}{*}{**Architecture**} & \multirow{2}{*}{**MAE Training**} & \multicolumn{2}{c}{**MAE**} & \multirow{2}{*}{**MSE Training**} & \multicolumn{1}{c}{**MSE**} \\  & & **Validation** & & **Validation** \\ \hline FCNN & 0.2177 & 0.2068 & 0.0667 & 0.0601 \\
1D-CNN & 0.2177 & 0.2078 & 0.0667 & 0.0606 \\ LSTM & 0.0143 & 0.0098 & \(3.5220\times 10^{-4}\) & \(1.6166\times 10^{-4}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Performance of the three proposed architectures. The best results are noted in bold. Hypothetical radiation patterns with high prediction difficulty were generated as input to the DNN with better performance (i.e., the previously trained and validated LSTM), resulting in amplitudes and phases for the antenna array. In Figure 5, the power pattern synthesis related to these idealized patterns (i.e., radiation patterns of arbitrary shapes not produced by antenna array) is shown. Figure 5a illustrates an optimal triangular input pattern, where the base of the triangle has an angular range from 85\({}^{\circ}\) to 140\({}^{\circ}\) and the opposite vertex to the base points at 120\({}^{\circ}\) with a gain of one. In the same manner, a perfectly square input pattern exhibiting a unit gain within the angular span of 40\({}^{\circ}\) to 70\({}^{\circ}\) is depicted in Figure 5b.