# Physically-Data Driven Approach for Predicting Formation Leakage Pressure: A Dual-Drive Method
## Theory and Methods  
### LSTM Algorithm Theory  
LSTM (long short-term memory) is an enhanced algorithm derived from the RNN (recurrent neural network) [26]. It offers notable advantages in solving long sequence memory problems, facilitating better gradient propagation, and mitigating the problems of gradient vanishing or exploding. Consequently, these advantages position it as a pivotal technology in domains like natural language processing and speech recognition [27]. In comparison to traditional RNN, LSTM exhibits several noteworthy advantages:  
1. Long-term dependencies: Traditional RNNs encounter challenges in managing long sequence dependencies, whereas LSTM can preserve long-term dependencies by regulating the flow of information. 2. Avoiding gradient vanishing or exploding: Traditional RNNs are susceptible to the issues of gradient vanishing or exploding, whereas LSTM incorporates gate mechanisms to regulate the flow of information, effectively mitigating these problems. 3. Enhanced memory capacity: LSTM can selectively retain or discard past information through the control of the forget gate and input gate, thereby exhibiting improved memory capabilities. 4. Learning patterns in long sequences: LSTM can acquire patterns in long sequences by regulating the flow of information, facilitating superior processing of long sequence data. In conclusion, LSTM surpasses traditional RNN in its handling of long-term dependencies, ability to avoid gradient vanishing or exploding, improved memory capacity, and proficiency in learning patterns within long sequences. For a comprehensive depiction of the fundamental network structure of LSTM, please consult Figure 2. Its fundamental concept is rooted in extensive research on cell states and \"logic gates\". The cell state serves as the conduit for information transmission, facilitating the transfer of information across the sequence chain and functioning as the network's \"memory\". In theory, the cell state can persistently convey pertinent information throughout sequence processing, allowing information from earlier time steps to be propagated to subsequent time steps, thereby surpassing the constraints of short-term memory. In terms of information control, LSTM accomplishes this through a structure known as \"gate logic\". During the training process, the \"logic gates\" selectively retain or discard information based on their respective weights. The gate logic primarily encompasses the forget gate, input gate, and output gate, each fulfilling distinct functions [28; 29]. The forget gate regulates the retention or omission of the preceding layer's concealed cell state. The input gate evaluates the current input data to ascertain its relevance for updating the cell state. The output gate determines the value of the subsequent hidden state, encompassing the preceding input information [30]. The specific calculation formula is presented as Equation (1). \[ \begin{array}{l}\mathbf{f}_{t}=\mathit{sigmoid}\Big{(}\mathbf{W}_{f}\cdot[\mathbf{h}_{t- 1},\mathbf{x}_{t}]+\mathbf{b}_{f}\Big{)}\\ \mathbf{i}_{t}=\mathit{sigmoid}(\mathbf{W}_{i}\cdot[\mathbf{h}_{t-1},\mathbf{x}_{t}]+\mathbf{b}_{ i})\\ \mathbf{o}_{t}=\mathit{sigmoid}(\mathbf{W}_{o}\cdot[\mathbf{h}_{t-1},\mathbf{x}_{t}]+\mathbf{b}_{o}) \\ \widetilde{C}_{t}=\tan h(\mathbf{W}_{\mathbb{C}}\cdot[\mathbf{h}_{t-1},\mathbf{x}_{t}]+\bm {b}_{c})\\ \mathbf{C}_{t}=\mathbf{f}_{t}\cdot\mathbf{C}_{t-1}+\mathbf{i}_{t}\cdot\widetilde{C}_{t}\\ \mathbf{h}_{t}=\mathbf{o}_{t}\cdot\tan h(\mathbf{C}_{t})\end{array}