# A Novel Link-to-System Mapping Technique Based on Machine Learning for 5G/IoT Wireless Networks
## 4 Machine Learning Based Effective SNR Mapping Procedure  
The number of simulations was 10,000 for each input SNR and each CQI and 1000 TBs were generated for each simulation. BLER was determined for transmitted 1000 TBs. Thus, the size of raw data of \((SNR,\gamma_{1},\cdots,\gamma_{N_{RE}},BLER)\) to collect from LLS, i.e., the total number of simulation results per CQI was the product of the number of SNR values and the the number of simulations. In general, since the size of raw data from the LLS is large, obtaining the optimal parameters of \(\alpha_{1}^{*}\) and \(\alpha_{2}^{*}\) through heuristic search with Equation (10) is burdensome. Thus, it was necessary to reduce the computation complexity as well as to improve the accuracy. As shown in this section, we used Python Tensorflow framework and applied the DNN regression method to make an AWGN fitting curve of module \(M_{2}\) in Section 3.3. The algorithm of DNN regression is described in Algorithm 2 and Figure 3.  
1. We utilized the DNN regression method instead of the best fitting curve to obtain the BLER curve in AWGN channels. The DNN consists of several hidden layers between the input and output layers. Hidden layers of (100, 200, 100) layers were used in Adagrad optimizer [22]. As the number of hidden layers and the number of nodes at each hidden layer increased, MSE decreased. However, the improvement of MSE was saturated at three hidden layers with the number of nodes of (100, 200, 100), as shown in Figure 3. Learning rate was set to 0.1, which implies how quickly it is tuned to the target SNR value. The regularization strength to prevent over-fitting was set to 0.001. The sigmoid function \(1/(1+e^{-x})\) was used as an activation function in hidden layers.
2. DNN regression continued training for SNRs and BLERs on AWGN channel with the learning rate at each epoch. The number of training data was 4000.
3. After training data, BLERs were predicted for test set of SNRs. Finally, we obtained an enhanced AWGN curve of SNRs and BLERs.  
```
/*ConfigureDNNregression */
1 regressor=learn.DNNRegressor(feature_columns,hidden_units=[100, 200, 100], optimizer= tf.train.ProximalAdagradOptimizer(learning_rate=0.1,11_regularization_strength=0.001), activation_fn=tf.nn.sigmoid) /*Trainmeasureddataupto4000 times */
2 input_training_fn(awgn_snr,awgn_bler) regressor.fit(input_fn=input_training_fn,steps=4000) /*PredictofBLERsfortestSNRs */
3 input_reff_fn(-snrrange predictions=list(regressor.predict_scores(input_fn=input_reff_fn)) regressed_bler=np.asarray(predictions)
```  
**Algorithm 2**DNN regression.  
Next, we applied the optimization algorithm to efficiently find \((\alpha_{1}^{*},\alpha_{2}^{*})\), which is summarized in Algorithm 3.  
1. To find the optimal parameters \((\alpha_{1}^{*},\alpha_{2}^{*})\), we loaded raw data from module \(M_{1}\) in Section 3.2.
2. In the ML scheme, the loss function is defined as the difference between the calculated effective SNR value from Algorithm 3 and AWGN SNR obtained from Algorithm 2 at the same BLER. We calculated loss as the expectation of loss function over BLERs. The loss function and MSE of Equation (9) were used almost synonymously.
3. We applied optimization algorithms, Adagrad and RMSProp, to find the optimal parameters that minimize the loss function. Since Adagrad and RMSProp adapt the learning rate to the parameters, they eliminate the need to manually tune the learning rate. Adagrad optimizer adapts the learning rates by scaling them inversely proportional to the sum of the historical squared values of the gradient. In contrast, RMSprop optimizer modifies AdaGrad for a nonconvex setting by changing gradient accumulation into exponentially weighted moving average [23].
4. With the optimal parameters, the mean squared error (MSE) was calculated by \[\text{MSE}=\sum_{i=1}^{M}\Big{[}\log_{10}BLER_{i}-\log_{10}BLER_{R}\left(\gamma _{\text{eff}}^{i}(\alpha_{1}^{*},\alpha_{2}^{*})\right)\Big{]}^{2}.\] (11)  
Figure 3: Deep neural network.