## 2 Materials and Methods
### Long Short-Term Memory  
RNNs have the advantages described in the previous section as well as the following limitations. (1) As shown previously in Figure 4, multiple neural networks are connected, and the same weight is multiplied several times, resulting in a gradient explosion problem and a gradient vanishing problem [38]. (2) RNNs reflect information from the past, but as time progresses the previous information arrives in a weakened state, making it difficult for the network to incorporate older data. (3) Finally, RNNs have difficulty distinguishing between continuously delivered information and unnecessary data that should be deleted. Therefore, an LSTM that uses a new \"gate\" concept to solve the gradient vanishing problem, and the information transmission problem can be utilized [39]; this gate decides whether to remember or delete the current data. Representative studies of LSTMs include handwriting recognition [40], handwriting generation [41], speech recognition [42], machine translation [43], and image captioning [44,45].  
Figure 5 shows the structure of the LSTM. The interior of the LSTM block consists of a cyclic memory cell and three types of gates (input, forget, and output gates). The  
Figure 4: Structure of a recurrent neural network.  
Figure 3: Proposed wiring diagram of the solar power system.  
LSTM calculates the final output through a hidden layer like the RNN but controls the flow of information by appropriately using the three gates during the calculation of the hidden layer. The input gate controls the amount of the current input state (\(c_{t}\)) flowing to the current cell state (\(s_{t}\)). The forget gate controls the amount of the cell state before time \(t\) (\(s_{t-1}\)) flowing to the cell state at time \(t\) (\(s_{t}\)). The states of the LSTM cells are computed as follows in Equations (3)-(5) [46; 47], where \(g_{t}\), \(f_{t}\), and \(q_{t}\) are the input, forget, and output gates, respectively:  
\[g_{t}=\sigma\big{(}\left(U_{g}\times x_{t}+W_{g}\times\ h_{t-1}\right)+b_{g} \big{)}, \tag{3}\]  
\[f_{t}=\sigma\Big{(}\left(U_{f}\times x_{t}+W_{f}\times\ h_{t-1}\right)+b_{f} \Big{)}, \tag{4}\]  
\[q_{t}=\sigma\big{(}\left(U_{q}\times x_{t}+W_{q}\times\ h_{t-1}\right)+b_{q} \big{)}. \tag{5}\]  
The \(c_{t}\) is calculated by applying \(U_{c}\), \(W_{c}\), and \(b_{b}\) to the input data at time \(t\) and the hidden layer (\(h_{t-1}\)) at time (\(t-1\)), respectively. The \(s_{t}\) calculates the current information using \(c_{t}\), \(g_{t}\) and \(f_{t}\). The hidden node (\(h_{t}\)) is calculated using \(s_{t}\) and \(q_{t}\). Finally, the current output state (\(o_{t}\)) multiplies the hidden layer by \(V\).  
\[c_{t}=tanh((U_{c}\times x_{t}+W_{c}\times\ h_{t-1})+b_{c}), \tag{6}\]  
\[s_{t}=f_{t}\times s_{t-1}+g_{t}\times c_{t}, \tag{7}\]  
\[h_{t}=q_{t}\times tanh(s_{t}), \tag{8}\]  
\[o_{t}=V\times h_{t}, \tag{9}\]  
In Equations (6)-(9), \(U_{g}\), \(U_{f}\), \(U_{q}\), \(U_{c}\), \(W_{g}\), \(W_{f}\), and \(W_{q}\) are the weights of the input value \(x_{t}\) and the previous hidden layer (\(h_{t-1}\)) at time \(t\) for each gate, respectively; \(b_{g}\), \(b_{f}\), \(b_{q}\), and \(b_{c}\) are the biases of \(g_{t}\), \(f_{t}\), and \(q_{t}\), and \(c_{t}\), respectively.