## 3 The Extrapolation Prediction Method
### Dbn-Dnn  
DBN-DNN does not need to establish the exact expression of the relationship between input and output. It can obtain the complex nonlinear mapping relationship between input and output through a lot of learning. It has the ability to express the data characteristics layer by layer and then deeply mine the data value. The DBN-DNN structure is shown in Figure 9. DBN-DNN is composed of DBN and DNN. Firstly, the whole DBN is initialized by a greedy unsupervised learning algorithm. After layer-by-layer training, the abstract feature vector learned by DBN is used as the input of DNN, which enables the network to be trained quickly, efficiently, stably, and reliably. Finally, the BP algorithm is used to train a DNN supervised to fit the label data. Figure 8: Flow chart of extrapolation prediction method. DBN consists of multiple stacked Restricted Boltzmann Machine (RBM) units; each RBM consists of a visible layer and a hidden layer, and the neurons of the visible layer and the hidden layer are fully connected in both directions. The RBM is an energy model where the energy function is defined as \(E_{\theta}(v,h)\) for a set of state quantities (\(v,h\)), and the joint probability distribution of the hidden layer and the visible layer is defined as \(P(v,h)\). \[\left\{ \begin{array}{l}E_{\theta}(v,h)=-\sum_{i=1}^{n}\!\!a_{i}v_{i}-\sum_{j =1}^{m}\!\!b_{j}h_{j}-\sum_{i=1}^{n}\!\!\!\sum_{j=1}^{m}\!\!v_{i}w_{ij}h_{j}\\ P(v,h)=\frac{1}{Z_{\theta}}e^{-E_{\theta}(v,h)}\end{array} \right. \tag{5}\]  
In the formula, \(v_{i}\) and \(h_{j}\) are the state vectors of the visible layer and the hidden layer, respectively; \(a_{i}\) and \(b_{j}\) are the bias vectors of the visible layer and the hidden layer, respectively; \(n\) and \(m\) are the units number of the visible layer and the hidden layer, respectively; \(w_{ij}\) is the weight between \(v_{i}\) and \(h_{j}\); \(\theta=(a_{i}\), \(w_{ij}\), \(b_{j})\) is the parameters of the model; and \(Z_{\theta}\) is the normalization coefficient. Figure 9: The structure of DBN-DNN. The states of the visible and hidden layer neurons of the RBM are conditionally independent, and the probability of each neuron taking the value condition is calculated as  
\[\left\{ \begin{array}{l}P(h_{j}=1|v)=\sigma(b_{j}+\sum\limits_{i=1}^{n}v_{i}w_{i \bar{j}})\\ P(v_{i}=1|h)=\sigma(a_{i}+\sum\limits_{j=1}^{m}w_{i\bar{j}}h_{j})\end{array} \right. \tag{6}\]  
In the formula, \(\sigma(\cdot)\) is the activation function. In this paper, ReLU is used as the activation function, which can overcome the gradient disappearance and retain data information very well. On the other hand, it makes the network sparse, alleviating the overfitting problem. In this paper, the network parameters are adjusted by the maximum likelihood estimation method, so the goal of training the RBM is to maximize the likelihood function \(L(\theta)\) of the network to obtain the parameter \(\theta\), that is  
\[L(\theta,v)=\prod\limits_{i=1}^{n}p(v^{i}) \tag{7}\]  
To simplify the calculation, it can be written in the logarithmic form shown in Equation (8). Additionally, the Contrasting Divergence (CD) algorithm [23] is used to train the RBM. \[\left\{ \begin{array}{l}\text{ln}L(\theta,v)=\sum\limits_{i=1}^{n}\text{ln}\,p (v^{i})\\ \theta=\text{argmax}L(\theta)=\text{argmax}\sum\limits_{i=1}^{n}p(v^{i})\end{array} \right. \tag{8}\]  
In this paper, in the study of the electromagnetic railgun, the armature electromagnetic force is the output variable, and the excitation current, time, velocity, and armature conductivity, which affect the armature electromagnetic force, are the input variables. The armature electromagnetic force and its influence parameters obtained by numerical simulation are used to train the DBN-DNN, so that the DBN-DNN can learn the complex nonlinear mapping relationship to realize the extrapolation prediction of the armature electromagnetic force in the stage of \"pseudo-oscillation\". When setting the network structure, the number of hidden layers is selected as four.