# A Deep Learning Approach for Maximum Activity Links in D2D Communications
## 6 Performance Evaluation  
In our proof-of-concept evaluation scenario the nodes are randomly placed on an area of 250 m\({}^{2}\). The channel gain is \(g_{ij}=d_{ij}^{-3}\), where \(d_{ij}\) is the distance between D2D users \(i\) and \(j\). The detailed simulation parameters are given in Table 2:In Figure 4, we compare the time required (seconds) for reaching optimality with the DNN-based algorithm against the ones experienced by using respectively the conventional integer linear programming optimization scheme solved with CPLEX (C-Solver) and the maximum weighted links scheduling (MWLS) algorithm, a greedy approach for D2D link scheduling under the SINR constraints based on [27; 28]. The TensorFlow framework has been used to train the DNN-based algorithm. We determined the average calculation time for each case. From Figure 4, we can see that the computation time based on the DNN algorithm was considerably reduced when compared to the ones characterizing the other optimization approaches. In addition, as the scale of the instance increases, the computational time of the other algorithms increases as well according to a huge growth trend. Instead, for the DNN-based approach the computational time growth with the problem scale is not so obvious. In Table 3, we compare the effect of the number of hidden layers in our solution. To keep the comparison fairer, both of the models shared the same number of hidden units in total. The two-layer-deep model had 60 units per layer, while the model with three layers had 40 units per layer. We focused on time and accuracy as comparison metrics. In terms of time, we observed the training time and testing/validation time of the learning model with two and three hidden layers. To estimate accuracy, we relied on a binary variable denoting the link status: 1 meant that the D2D link was activated and the other link was asleep. The binary accuracy of the output link status has been used to show the performance of the model in training and testing. Table 3 shows that the three-layer structure spent more time in the training and testing than the two-layer model. Since the total number of neurons was the same, the accuracy only experiences little differences. \begin{table}
\begin{tabular}{l c} \hline \hline
**Parameter** & **Value** \\ \hline Cell Radius/m & 250 \\ Number of Cellular Users & 1 \\ Transmit Power of D2D & 0.01 \\ \(\gamma_{C}\) & 10 \\ \(\gamma_{D}\) & 10 \\ \(\eta\)/mw & \(10^{-}\)10 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameters setting of simulation. Figure 4: Comparison of computation time. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Metrics** & **2 Hidden Layers** & **3 Hidden Layers** \\ \hline Training Time & 1h 24 min & 1h36 min \\ Testing time (on 10k) & 0.247032s & 0.233568s \\ Binary accuracy on training & 0.99458 & 0.99356 \\ Binary accuracy on testing & 0.99320 & 0.99261 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Results of the comparison between different number of layers. In Figure 5, we set 60 units per layers for both models. According to Figure 4, it is reasonable to keep the depth of the DNN limited to three hidden layers. Training accuracy is better for a three-layer network while keeping the testing time within acceptability bounds. The difference in terms of accuracy between the two models can be explained by the number of weights that need to be trained. Weights are several times more numerous in the three-layer than in the two-layer model. Due to the vanishing gradient, we can observe the training loss declined gradually as the number of training steps increase. It is critical to choose a proper batch size to effectively prevent the model from underfitting and overfitting. We compared the validation loss and training time with different batch sizes and learning rates, and the results are shown in Figure 6. The values of learning rate and batch size were decided by an experimental comparison with a constant value of epoch.