# Exploration of Multi-Scale Reconstruction Framework in Dam Deformation Prediction
## 2 Materials and Methods
### Long Short-Term Memory Network (LSTM)  
LSTM is transformed from Recurrent Neural Network (RNN), which solves the problem of gradient disappearance and gradient explosion caused by the long-term dependence of RNN on the time series, and can effectively deal with the prediction problem of the time  
Figure 1: Decomposition results of analog signals based on VMD.  
Figure 2: Variation of the mean values of the instantaneous frequencies of the components corresponding to different moduli.  
series [18]. The essence of RNN is to add a feedback mechanism to the fully connected neural network, which determines that the output of the network is not only related to the current input, but also related to the previous output while LSTM adds a memory unit on the basis of RNN. Compared with RNN, LSTM has a longer memory time, but its control process is similar to RNN. They both process the data flowing through the cell in the process of forward propagation. The difference is that the structure and operation of the cells in LSTM have changed.  
The structure of LSTM is shown in Figure 3. It is mainly composed of a memory unit that stores the information state and three gate control units to regulate the flow of information in and out of the memory unit. The memory unit can retain time sequence hidden information to achieve the purpose of using longer time sequence information. The three gating units mainly use the activation function to change the information state in the memory unit, while the input gate is mainly to update and store the information in the cell state, and the output gate selects the useful part for prediction from the final memory unit. The cell unit update status of LSTM is as follows below.  
Forgetting gate: It outputs a 0-1 vector by checking the information of the sum to determine how many memories of the cell state in the previous period need to be forgotten. At this time, the output of the cell state is:  
\[f_{t}=\sigma\Big{(}W_{f}\cdot[h_{t-1},x_{t}]+b_{f}\Big{)} \tag{8}\]  
Input gate: Using \(h_{t-1}\) and \(x_{t}\) to decide what new information to add to the cell state, the update Formula is as follows  
\[i_{t}=\sigma(W_{i}\cdot[h_{t-1},x_{t}]+b_{i}) \tag{9}\]  
\[\widetilde{C}_{t}=\tan\h(W_{c}\cdot[h_{t-1},x_{t}]+b_{c}) \tag{10}\]  
Cell state update: Using the state \(f_{t}\) output by the forget gate and the \(i_{t}\) and \(\widetilde{C}_{t}\) obtained from the input gate to update the cell state so that the next state can be used. The update Formula is as follows:  
\[C_{t}=C_{t-1}\odot f_{t}+i_{t}\odot\widetilde{C}_{t} \tag{11}\]  
Output gate: After updating the cell state, it is necessary to determine which state features of the output cell are based on the sum of the inputs. The calculation Formula is:  
\[o_{t}=\sigma(W_{o}\cdot[h_{t-1},x_{t}]+b_{o}) \tag{12}\]  
\[h_{t}=o_{t}\tan\h(C_{t}) \tag{13}\]  
Figure 3: LSTM schematic.  
In the Formulas (8)-(13), \(W_{f}\), \(W_{i}\), \(W_{o}\) and \(b_{f},\ b_{i},\ b_{o}\) are the weight matrix and bias of the forgetting gate, input gate, and output gate, respectively, and \(\sigma\) is the activation function.  
As shown in Figure 3, the output of one cell state on the hidden layer will be used as the input of the next state. This transfer mechanism makes LSTM have better learning and memory capabilities. This allows the model to obtain the optimal parameters through iteration. In essence, iteration is a process of seeking optimization, and its loss function is the objective function. In this article, the Adam optimizer is used for stochastic gradient descent. Compared with other optimizers, Adam is more efficient and has fewer parameters.