## 5 Results and Discussions
### Performance of Prediction Accuracy and Interpretation in Time Dimension
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multicolumn{3}{c}{**Training**} & \multicolumn{3}{c}{**Test**} \\ \cline{2-7}  & **RMSE** & **MAE** & **AE\({}_{\text{max}}\)** & **RMSE** & **MAE** & **AE\({}_{\text{max}}\)** \\ \hline Attention before LSTM & 0.1337 & **0.1248** & 3.0304 & **0.0498** & **0.1535** & **2.6235** \\ Attention after LSTM & 0.0758 & 0.1801 & **3.0295** & 0.0646 & 0.1846 & 2.7444 \\ LSTM & **0.0498** & 0.1752 & 3.1269 & 0.0798 & 0.2037 & 3.1708 \\ RF & 0.2662 & 0.3987 & 2.3540 & 2.2030 & 1.2282 & 4.1766 \\ SVM-rbf & 0.5777 & 0.5598 & 2.7555 & 2.3969 & 1.2799 & 4.4931 \\ SVM-poly & 3.3283 & 1.5504 & 4.0004 & 2.6943 & 1.3880 & 3.7492 \\ MLP & 0.6858 & 0.6561 & 3.5570 & 2.5970 & 1.3364 & 4.5004 \\ HST & 0.8714 & 0.7424 & 3.5900 & 3.6562 & 1.7142 & 4.7921 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Performance comparison of different models. Figure 11: Comparison of the inherent stability and predictive performance of different models. Meanwhile, in order to verify the reliability of the proposed model, drawing residuals plot of the better model, as shown in Figure 13. The results show that the proposed model has weaker residual autocorrelation than LSTM model, and its residual value distribution is more uniform. Although there are a few residual points of the proposed model on the residual graph with irregular distribution, most of residual points are evenly spread on both sides of 0. The residual distribution demonstrates unpredictability and randomness. Therefore, the LSTM model coupled with attention mechanism can fully capture the available information in the dam deformation influence factor. Figure 12: Predictive fitting curve of the LSTM and coupled models. Figure 13: Residuals distribution plot of different models: (**a**) attention mechanism is coupled before LSTM; (**b**) attention mechanism is coupled after LSTM; and (**c**) LSTM. The attention mechanism helps to automatically focus on important factors in the time dimension. This addition significantly improved the ability of the LSTM model to predict the peaks in the observed data. Furthermore, with the attention mechanism, the outliers in the forecasting data were relatively minor and the distribution of the residuals was also relatively concentrated. However, the attention mechanism performance depended on its coupling position, preceding or following the LSTM, and the results showed that when it is coupled before the LSTM layer it had better prediction accuracy. For dam deformation predictions, recent data has a stronger reference value and, as shown in Figure 14, attention disorder occurs when the attention mechanism is coupled after the LSTM layer. This is because after the data is processed by the LSTM layer it will be mapped into a complex high-dimensional tensor which makes it difficult for the attention mechanism to accurately focus on important factors. These observations demonstrated that the attention mechanism should be placed before the LSTM layer to better predict the structural response of dams using complex nonlinear factors and time delay information.