# Research on Satellite Network Traffic Prediction Based on Improved GRU Neural Network
## 4 Traffic Prediction Method of the AT-GRU Satellite Network
### PSO Algorithm for GRU Hyperparameter Selection Problem  
There are many network hyperparameters in the construction of a neural network, such as Learning_rate, number of neurons, and epoch. These hyperparameters not only determine the fitting effect of the neural network but also affect the training effect of the model. To achieve the best effect on the network, a strategy should be adopted to determine the values of these hyperparameters. The PSO algorithm is an optimization method based on Swarm Intelligence. Its advantages lie in its simplicity, easy implementation, and profound intelligent background. It is suitable for both scientific research and engineering applications, and there are not many parameters to adjust. Combining the good global optimization ability of the PSO algorithm with a neural network can improve the generalization ability and learning performance of a neural network, thus improving the overall working efficiency of the neural network. In this paper, the values of hyperparameters are determined according to the results of the PSO algorithm, and the optimal structure of the network model is obtained. A particle of PSO represents a hyperparameter combination scheme. In this experiment, a particle is an array of [Number of neurons, Learning_rate, Epoch]. PSO is the process of calculating the fitness of each particle's corresponding scheme and finding the most suitable scheme. The target function selected by PSO algorithm in this paper is the fitness function. In order to calculate the fitness value of each particle, fitness function takes the sum of errors between the predicted value and the real value; we set the best fitness function as:  
\[f=\frac{1}{N}\sum_{i=1}^{N}(y_{i}-\widetilde{y}_{i})^{2}, \tag{20}\]  
where \(N\) is the number of samples, \(y_{i}\) is the actual value, and \(\widetilde{y}_{i}\) is the predicted value. This paper applies the constraint condition of the algorithm, that is, the value range of the hyperparameters. [PERSON] et al. 's research [23] provides the rules of hyperparameter configuration for neural networks. According to the above references, the initial population number is 20, the position range of each particle is [1, 150], [0.001, 0.15], [100, 700], that is, the number of neurons is set between [1, 150], the learning rate is set between [0.001, 0.15], and the number of iterations is set at [100, 700]. The particle update formula is as follows:  
\[v_{i}=v_{i}+c1\cdot rand\cdot(\mathit{pbest}_{i}-a_{i})+c2\cdot rand\cdot( \mathit{gbest}-a_{i}), \tag{21}\]  
\[a_{i}=a_{i}+v_{i}. \tag{22}\]In which \(v_{i}\) is the velocity of the particle, \(a_{i}\) is the current position of the particle, \(i=1,2,\ldots,N\), \(N\) is the total number of particles in the particle swarm, \(rand\) is a random number, \(pbest_{i}\) is the local optimal solution of the particle \(i\), \(gbest\) is the global optimal solution of the particle swarm, that is, \(gbest\) is the best value among all \(pbest_{i}\), and \(c1\) and \(c2\) are learning factors. According to the research of [PERSON] et al. [24], \(c1\) and \(c2\) in this paper are set \(c1=c2=2\). The Hyperparameter algorithm description of the PSO model is shown in Algorithms 1: Description of Hyperparameter algorithm of PSO optimization model. ```
Input: Initialize parameters such as population size and iteration times; Outputs: Optimal hyperparameters of neural network;
1. Procedure PSO;
2.\(i=[Number\ of\ neurons,Learning\_rate,Epoch]\)
3.for each particle \(i\)do
4. Initialize the velocity \(v_{i}\) and position of particle \(i\)
5. Evaluate particle \(i\) and set \(pbest_{i}=a_{i}\)
6.endfor
7.\(gbest=\min\{pbest_{i}\}\);
8. While not stopping do
9.for\(i=1\) to \(N\)do
10. Update the velocity and position of the particle \(i\);
11. Evaluate particle \(i\);
12.if\(fit(a_{i})<fit(pbest_{i})\)then
13.\(pbest_{i}=a_{i}\)
14.endif
15.if\(fit(pbest_{i})<fit(gbest)\)then
16.\(gbest=pbest_{i}\)
17.endif
18.endfor
19.endwhile
20.