## 7 Channel Estimation-Based DL Algorithm
### Dataset Generation  
At the beginning of every training stage, the weights and bias values of LSTM layer are initialized, and during the training phase, weights and biases are modified according to a gradient descent procedure [5,30]. The distance of each user from the BS and the path loss exponent needs to be assigned in the dataset, so that the channel coefficients for each user are randomly generated to model the Rayleigh fading channel between the user and BS. Pilot symbols are generated at random and recognized at the BS and at the receiver side of each user. On the basis of the initial channel factors generated and the pilot symbols, the size of the training and testing frames can be identified. The training model are carefully established based on the selected layers, the hidden units assigned for each layer, and the training parameters. In order to further accelerate and stabilize the training process of the training network, we choose to normalize the training data. Throughout the training phase, the performance of the proposed DNN model-based LSTM layer is assessed using RMSE and loss functions. In the testing period, new fading coefficients will be randomly generated, such that these coefficients are not the same as those generated for training. Once the training and testing sequences are inspected using the training network, the trained model will be employed as online channel estimator for the users. The proposed DL technique for channel estimation can be outlined as shown in Algorithm 1. Figure 3: Internal structure of LSTM cell. ```
1. Initialize the learnable parameters of an LSTM layer \((\mathbf{W},\mathbf{R},\mathbf{b})\), where \(\mathbf{W}\) is the input weights, \(\mathbf{R}\) is the recurrent weights, and \(\mathbf{b}\) is the bias. Inputs
* Number of Iterations. * The distance of each user from the BS. * Path loss exponent. * Generate Initial random Rayleigh channel coefficients for each user based on the channel model. * Generate known pilot symbols. * Assign the initial power factors for each user. * Identify the size of training sequence \((\mathbf{L}_{\mathbf{T}})\) and size of testing sequence \((\mathbf{L}_{\mathbf{S}})\). Procedure
2. Assign the training sequence \((\mathbf{Z}_{\mathbf{T}})\), testing sequence \((\mathbf{Z}_{\mathbf{S}})\), and the desired coefficients \((\mathbf{Z}_{\mathbf{D}})\). 3. Calculate the mean and variance \((\mathbf{\mu}_{\mathbf{T}},\ \sigma_{\mathbf{T}}^{2})\) for channel coefficients in training sequence at each iteration. 4. Normalizing the training data \(\mathbf{Z}_{\mathbf{T}}\rightarrow\mathbf{Z}_{\mathbf{NT}}\) based on \((\mathbf{\mu}_{\mathbf{T}},\ \sigma_{\mathbf{T}}^{2})\). 5. Characterize the relationship between consecutive normalized training sequences as \(\mathbf{Z}_{\mathbf{NT}\succeq}(\mathbf{X}_{\mathbf{NT}},\ \mathbf{Y}_{\mathbf{NT}})\). 6. Initialize the training network \((\mathbf{T}_{\mathbf{net}})\) and assign the following:
7. Number of layers. 8. Number of hidden units. 9. Training parameters. 10. Use \((\mathbf{X}_{\mathbf{NT}},\ \mathbf{Y}_{\mathbf{NT}})\) as inputs for the training model \((\mathbf{T}_{\mathbf{net}})\). 11. **Predict** the output normalized coefficients \((\mathbf{Y}_{\mathbf{NP}})\). 12. **Update** the state of training model \((\mathbf{T}_{\mathbf{net}})\). 13. **For i = 1: \(\mathbf{L}_{\mathbf{T}}\) \([\mathbf{T}_{\mathbf{net}},\ \mathbf{Y}_{\mathbf{NP}}]\) = Predict and Update state \((\mathbf{T}_{\mathbf{net}},\ \mathbf{Z}_{\mathbf{NT}})\) End
14. Denormalize \(\mathbf{Y}_{\mathbf{NP}}\rightarrow\mathbf{Y}_{\mathbf{P}}\). 15. Calculate RMSE \((\mathbf{Z}_{\mathbf{D}}-\mathbf{Y}_{\mathbf{P}})\) and Loss function. 16. **Update** the state of \((\mathbf{T}_{\mathbf{net}})\) and reset the values for \(\mathbf{Y}_{\mathbf{P}}\). 17. Normalize testing data \(\mathbf{Z}_{\mathbf{S}}\rightarrow\mathbf{Z}_{\mathbf{NS}}\), using \((\mathbf{\mu}_{\mathbf{T}},\ \sigma_{\mathbf{T}}^{2})\). 18.