## 3 Materials and Methods
### Rnn  
A recurrent neural network (RNN) is a neural network model designed to learn the temporal dependencies and correlations in sequential data. It is widely used in time-series analysis and natural language processing applications. Unlike MLP, which processes inputs independently, RNN consists of an input layer, hidden layers, and an output layer, as shown in Figure 2. Each time step combines the previous hidden state with the current \begin{table}
\begin{tabular}{c c} \hline
**Parameter** & **Value** \\ \hline Batch size & 32 \\ Momentum & 0.9 \\ Weight decay & L2 0.01 \\ Epochs & 300 \\ Learning rate & 0.001 \\ Optimizer & Adam \\ Workers & 1 \\ \hline \end{tabular}
\end{table} 
Table 1: MPL Training parameters. input to process and propagate information. A key feature of RNN is that it shares the same weights and biases across time steps. This allows it to maintain information flow while reducing the number of parameters, making it highly effective for learning from sequential data. Mathematically, at each time step t, the hidden state \(h_{t}\) is computed using the current input \(x_{t}\), the previous hidden state \(h_{t-1}\), and the bias term \(b_{h}\), as follows:  
\[h_{t}=f(W_{xh}x_{t}+W_{hh}h_{t-1}+b_{n}) \tag{3}\]  
where \(W_{xh}\) represents the weight matrix from the input data to the hidden state, \(W_{hh}\) is the weight matrix from the previous hidden state to the current hidden state, and f(\(\cdot\)) denotes the nonlinear activation function. The hidden state is the model's internal memory, enabling it to learn patterns in time-series or numerical data. In the output layer, the final output \(y_{t}\) is computed based on the hidden state as follows:  
\[y_{t}=W_{hy}h_{t}+b_{y} \tag{4}\]  
where \(W_{hy}\) represents the weight matrix from the hidden state to the output layer and \(b_{y}\) denotes the bias vector in the output layer. While RNN provides a structural advantage in learning temporal information, it faces the vanishing gradient problem during training. This issue arises when long-term dependencies become difficult to capture as past information gradually fades over time. Long short-term memory (LSTM) and gated recurrent unit (GRU) architectures have been developed to address this. LSTM retains important information over extended sequences by utilizing input and output and forgets gates to store and discard information selectively. GRU achieves similar performance with a simplified structure, improving computational efficiency. During training, backpropagation through time (BPTT), a variation of the backpropagation algorithm, is used to update weights. The sparse categorical cross-entropy loss function is applied for classification tasks, while mean squared error (MSE) is used for regression problems. The Adam optimizer is employed to adjust the learning rate efficiently. The reason for using the Adam optimizer in the RNN model is to mitigate the vanishing gradient problem and enable effective learning of sequential data. RNNs have a recursive structure, where past information is utilized to generate current outputs. However, during backpropagation, the vanishing gradient problem is likely to occur, making learning difficult. If SGD is used, gradients may diminish over time when training on long sequences, leading to a situation where information is no longer transmitted effectively. To prevent this, applying the Adam optimizer helps correct gradient variations by leveraging momentum and adaptive learning rate adjustments, thereby mitigating the long-term dependency issue. Additionally, RNNs capture temporal variations in sequential data and Adam optimizes weight updates at each time step, allowing for more effective learning of dynamic patterns. In mini-batch training, [PERSON] adjusts the learning rate for each weight separately, ensuring stable training even when dealing with significant gradient fluctuations. The experimental  
Figure 2: RNN model structure.