## 2 Materials and Methods
### Machine Learning Methods  
#### 2.3.1 Artificial Neural Networks (ANNs)  
ANNs are statistical learning algorithms that possess prediction and approximation abilities given sufficient and considerable inputs [26]. ANNs are derived from the biological neural networks in the human brain. Interconnected artificial neural networks are usually composed of neurons that can deal with the inputs and follow various situations. ANNs are suitable not only for machine learning but also pattern recognition. Therefore, ANNs have become a popular way of indicating a function by observation in the case of complex data. Figure 3a shows a typical ANN structure, including input, hidden, and output layers. In this study, several ANN methods, including the backpropagation neural network (BPNN), extreme learning machine (ELM), probabilistic neural network (PNN), and long short-term memory (LSTM) neural network, were used to develop variable-flow models. The BPNN and ELM are feedforward neural networks with no cycles or loops. Information propagates in one direction, forward from the input layer, through the hidden layer, and then to the output layer, in a feedforward neural network. The activation function can introduce a nonlinear factor to the neuron so that the ANN can approximate any nonlinear function. In the present study, a sigmoid function was adopted in the BPNN model and ELM model. For the sigmoid activation function, it holds that  
\[f(z)=\frac{1}{1+exp(-z)}, \tag{1}\]  
where the output of the sigmoid function is between 0 and 1. For the binary classification task, the output of the sigmoid is divided into a positive class/negative class when the output satisfies a certain probability condition. Figure 2(b) shows the schematic of the LSTM network. The LSTM network is a special  
Figure 3: Artificial neural network architectures: (**a**) the typical structure of an ANN; (**b**) the LSTM architecture; (**c**) the PNN architecture. Figure 2: Design of control system in the variable-flow RAS. RNN focusing on long sequences of data [27]. A standard LSTM unit comprises a cell, an input gate, an output gate, and a forget gate to solve the long-term dependency problem. Long-term memory information is stored during three steps (forgetting, remembering, and outputting) in an LSTM. In the present study, a rectified linear unit (ReLU) function was applied in the LSTM model. The ReLU function is described as  
\[f(x)=\max(0,x), \tag{2}\]  
which means that  
\[\text{ReLU}(x)=\left\{ \begin{array}{cc}x,&x>0\\ 0,&x\leq 0\end{array} \right.. \tag{3}\]  
The convergence rate of the stochastic gradient descent obtained by the ReLU function is much faster than the tanh/sigmoid function. However, the learning rate should be set appropriately to prevent neurons in the network from losing their activation ability. In this study, the parameters of the LSTM training process were set as follows: sequence input layer = 9, initial learning rate = 0.01, learning rate drop factor = 0.1, batch size = 128, number of training epochs = 200, hidden layer = 1 (with 32 hidden units). Adaptive moment estimation (Adam) was chosen as the optimization method. The fully connected layer was set as 2 for the binary classification task. Figure 3c shows the architecture of a typical PNN, which was first proposed by Dr. [PERSON] [28]. As a branch of a radial basis network, PNN has the advantages of a simple learning process and fast training time. Therefore, PNN models can be well implemented in hardware since the neuron number in each layer is fixed. Generally, a PNN network contains four layers: input layer, pattern layer, summation layer, and output layer. The input layer simply distributes the input to the neurons in the pattern layer. The pattern layer neuron may compute its output by Gaussian function when receiving \(x\) from the input layer.