# An Efficient Multivariate Autoscaling Framework Using Bi-LSTM for Cloud Computing
## 3 Proposed Autoscaling Framework
### Autonomic Manager
#### 3.2.2. Analyze Phase
\xrightarrow{\text{trained model}} (md_{1,t+1}) \tag{2}\]  
As expressed in Equation (2), the multivariate forecasting model in this paper attempts to predict the value at the next time step \(t+1\), given a history of multivariate time series dataset \(MD=md_{i,t}|i=1,2;j=t-w,\ldots,t-1,t\) in the past, where \(i\) and \(w\) denote the numbers of features and historical time step data, respectively. The proposed model comprises two features: the network received throughput and the feature with the highest correlation chosen from the feature selection service above. The multivariate Bi-LSTM forecasting service proposed in this paper collects historical metric data with size \(w\) from the Prometheus time series database. Then, the trained model uses the current collected data to predict the data at the next time step \(t+1\) of the network received throughput, \(md_{1,t+1}\). Although the dependencies of long-term states can be established theoretically, an RNN can only learn short-term dependencies because of the gradient vanishing problem [24]. This problem is called long-term dependence. LSTM is a special type of RNN. It was proposed by [PERSON] and [PERSON] in 1996 [25] to solve the RNN problem. Furthermore, it is used in various fields, including weather forecasting, image processing, video analysis, and time series forecasting. The long-term temporal dependence properties of time series data can be learned successfully using LSTM [25]. A typical LSTM unit consists of five components, as shown in the right corner of Figure 2. The inputs of the multivariate Bi-LSTM model include two features: \(X_{1}\) and \(X_{2}\), which are the network received throughput and the chosen feature from the feature selection service. Each red dashed box area presents a matrix of time series data of both input features at a specific time step. For example, the red dashed box area of \(X_{t-w}\) is a matrix \([x_{1,t-w},\)\(x_{2,t-w}]\) that contains two separate historical time series data of features \(X_{1}\) and \(X_{2}\), respectively, at time step \(t-w\). We use \(i_{t},f_{t},c_{t},o_{t}\), and \(h_{t}\) to respectively denote the input gate, forward gate, memory cell, output gate,and hidden state of a basic LSTM unit. The gates and memory cell of the LSTM unit allow it to memorize or forget information. \[i_{t}=\sigma(M_{i}x_{t}+N_{i}h_{t-1}+b_{i}) \tag{3}\]  
\[f_{t}=\sigma(M_{f}x_{t}+N_{f}h_{t-1}+b_{f}) \tag{4}\]  
\[o_{t}=\sigma(M_{o}x_{t}+N_{o}h_{t-1}+b_{o}) \tag{5}\]  
\[\tilde{c_{t}}=tanh(M_{c}x_{t}+N_{c}h_{t-1}+b_{c}) \tag{6}\]  
\[c_{t}=f_{i}\odot c_{t-1}+i_{t}\odot\tilde{c_{t}} \tag{7}\]  
\[h_{t}=o_{t}\odot tanh(c_{t}) \tag{8}\]  
We denote \(h_{t}\) and \(c_{t}\) as the hidden state and memory state of the LSTM, respectively. The LSTM computes \(h_{t}\) and \(c_{t}\) for an input time series value at time step \(t\). We denote \(\sigma\) and \(\odot\) as the activation function and Hadamard product (elementwise product), respectively. The Hadamard product is a binary operation that takes two matrices of the same dimensions and outputs a new matrix of the same dimensions as the operands. However, because LSTM can only learn the past context of time series data, it has a restriction. Thus, in this study, we propose to use Bi-LSTM. Bi-LSTM is a special type of LSTM [15] that has two LSTM layers for simultaneously processing the input time series data in two directions. The first LSTM processes sequence input data in a forward direction from \(t=1\) to \(t=T\). In contrast, the second LSTM processes the input data in the backward direction from \(t=T\) to \(t=1\). This Bi-LSTM architecture executes the input in two directions: from the past to the future and from the future to the past. Applying LSTM twice results in further learning of the long-term dependencies. Therefore, it improves the accuracy of the model.