# Deep Learning for Predicting Traffic in V2X Networks
## 5 Training DL-Based LSTM  
DL-based LSTM cells can be trained using a set of training sequences by combining a learning algorithm, such as gradient descent, with backpropagation in computing the gradients required in the learning process to change each LSTM network weight in proportion to the derivative of the error (on the LSTM network's output layer) with the corresponding weight. The issue with gradient descent in RNN is that as the distance between real events grows, the error gradients quickly vanish. Before one can realize the importance of connecting \begin{table}
\begin{tabular}{c l} \hline \(x_{t}\in\ \mathbb{R}^{d}\) & Input vector to the LSTM unit \\ \hline \(f_{t}\in\ (0,1)^{h}\) & Forget gate’s activation vector \\ \hline \(i_{t}\in\ (0,1)^{h}\) & Input/update gate’s activation vector \\ \hline \(o_{t}\in\ (0,1)^{h}\) & Output gate’s activation vector \\ \hline \(h_{t}\in\ (-1,1)^{h}\) & The hidden state vector is also known as the output vector of the LSTM unit \\ \hline \(\widetilde{C}_{t}\in\ (-1,1)^{h}\) & The candidate cell state is also known as the cell input activation vector \\ \hline \(C_{t}\in\ \mathbb{R}^{h}\) & Cell state vector \\ \hline \(C_{t-1}\in\ \mathbb{R}^{h-1}\) & The previous cell state vector \\ \hline \(W_{x}\in\ \mathbb{R}^{h\times d}\), \(W_{h}\in\ \mathbb{R}^{h\times h}\) and \(b\in\mathbb{R}^{h}\) & Weight matrices and bias vector parameters must be learned during training \\ \hline \(\sigma\) & Sigmoid function \\ \hline \(tanh\) & Hyperbolic tangent function \\ \hline \end{tabular} The superscript letters \(d\) and \(h\) denote the number of input features and the number of hidden units, respectively.  
\end{table} 
Table 1: List of LSTM variables. remote inputs, recurrent networks attempt to connect the result to the events in several steps. The error is still present in the LSTM unit cell even if the error values propagate back from the output layer. All LSTM cells receive this error repeatedly until they learn to ignore it. To predict the input and output time series, the future value of one time series must be predicted based on another time series. To predict the time series, either the historical values of both time series (for more accuracy) or simply one time series (for a simpler technique), can be used. Wireless networks were established to generate a collection of training data. The dataset for the training phase was collected, examined, and processed before being used to build an ML model for prediction. The dataset is split into two subsets, \"Input Series\" and \"Target Series\", and then split into 70% training and 30% testing after it is loaded into the network as input. The input data should be normalized to fall within the range [0, 1], This corresponds to the actual highest and lowest values. A deep neural network learns over a series of iterations called epochs. In the first epoch, random initialization values are first assigned for the weight (w) and bias (b) parameters. The input layer receives objects to observe data with known label values. These observations are usually categorized into packages (often called \"mini-packages\"). The neurons then perform their tasks and, if activated, pass the result to the next layer until the output layer provides a prediction. The prediction and the actual value are compared, and the difference between the two (which we call losses) is determined. The prediction with DL-LSTM networks is described in Algorithm 1. Based on the results, revised weights and bias values are estimated to reduce losses, and these adjustments are propagated back to the neurons in the network layers. The next epoch repeats the preliminary stage of batch training with modified values of weight and displacement, which should increase the model's accuracy (by reducing losses). One thousand epochs is the maximum number that can be used for training. The learning rate is initially set at 0.1. The drop period for the learning rate is 125, and the drop rate is 0.2.