## 3 Development of Virtual Sensor  
### LSTM-Autoencoder  
#### 3.1.1 LSTM  
LSTM is a type of recurrent neural network (RNN). The gradient vanishing problem of traditional RNNs in long-term memory is improved through the structure (input, forget, and output gates) [14; 15]. Accordingly, various studies have been conducted using LSTM in the HVAC field, which mainly deal with variables (such as energy consumption and load) influenced by data from previous time steps [16; 17; 18; 19]. The LSTM structure is shown in Figure 2.  
The working principle of LSTM is as follows. In the first step, the time-series data are input in vector form, and the forget gate determines the extent to which the previous time-step information should be forgotten. The degree of forgetting is determined by passing the current time-step information and previous time-step hidden layer value through a sigmoid function that outputs a value between 0 and 1. The degree of forgetting increases as the  
Figure 1: Overall research process. Figure 2: LSTM structure. value of the forget gate approaches zero. Conversely, the degree of forgetting decreases as the value approaches 1. The forget gate is calculated as follows:  
\[f_{t}=\sigma\Big{(}W_{xf}x_{t}+W_{hf}h_{t-1}+b_{f}\Big{)}, \tag{1}\]  
where \(f_{t}\) denotes the forget gate, \(\sigma\) denotes the sigmoid function, \(W_{xf}\) denotes the weight used in the forget gate, \(x_{t}\) denotes the current time-step information, \(h_{t-1}\) denotes the value of the previous time-step hidden layer, \(W_{hf}\) denotes the weight used for \(h_{t-1}\) in the forget gate, and \(b_{f}\) denotes the bias of the forget gate. In the second step, the input gate determines the extent to which the current time-step information should be remembered. To achieve this, the current time-step information and value of the previous time-step hidden layer are passed through a sigmoid function to output the input gate. Additionally, the current time-step information and value of the previous time-step hidden layer are passed through a tanh function to output the memory cell state. The input gate and state of the memory cell are respectively calculated as follows:  
\[i_{t}=\sigma(W_{xi}x_{t}+W_{hi}h_{t-1}+b_{i}), \tag{2}\]  
\[\widetilde{C}_{t}=\tanh(W_{xc}x_{t}+W_{hc}h_{t-1}+b_{c}), \tag{3}\]  
where \(i_{t}\) denotes the input gate, \(W_{xi}\) denotes the weight used in the input gate, \(W_{hi}\) denotes the weight used for \(h_{t-1}\) in the input gate, \(b_{i}\) denotes the bias of the input gate, \(\widetilde{C}_{t}\) denotes the state of the memory cell, tanh denotes the hyperbolic tangent function, \(W_{xc}\) denotes the weight used in the memory cell state, \(W_{hc}\) denotes the weight used for \(h_{t-1}\) in the memory cell state, and \(b_{c}\) denotes the bias of the memory cell state. In the third step, the memory cell is updated at the current time step. The memory cell at the current time step is calculated using the previously calculated forget gate, input gate, and memory cell state and then passed to the memory cell at the next time step. The updated state of the memory cell is calculated as follows:  
\[C_{t}=f_{t}\;*\;C_{t-1}+i_{t}\widetilde{C}_{t}, \tag{4}\]  
where \(C_{t}\) denotes the updated state of the memory cell at the current time step and \(C_{t-1}\) denotes the memory cell state passed from the previous time step. In the fourth step, the output gate determines the extent of the output information from the current time-step hidden-layer values. The output degree of the hidden layer values is determined by passing the current time-step information and value of the previous time-step hidden layer through a sigmoid function to output the output gate. Subsequently, this output is multiplied by the memory cell at the current time step and passed through a tanh function. At this time, the output information is sent to the hidden layer or LSTM cell at the next time step.