## 3 Combined Inertial Control Based on CAE and DNN
### Contractive Autoencoder  
From the whole combined inertial control frequency regulation procedure, it can be seen that the effect of frequency regulation depends mainly on the droop control parameter (\(K_{\mathrm{pf}}\)) and the virtual inertia control parameter (\(K_{\mathrm{df}}\)). In the same system, there always exists an optimal combination of control parameters when the wind speed, wind power proportion, and load disturbance are determined. Different optimal combinations of droop and virtual inertia control parameters obtained for these three different variables make up multidimensional data sets. The effectiveness of the prediction part depends to some extent on the selection, pre-processing, and feature learning of the input data. In order to make the subsequent prediction part more effective, a deep feature learning method called contractive autoencoder (CAE) is used in this paper, which not only reconstructs the input signal well, but also is invariant to the perturbations of the input data under a certain degree. The autoencoder (AE) network structure is shown in Figure 5[19]. It consists of an encoder and a decoder: the input vector is mapped into a feature vector in the implicit layer by the encoder, and then the feature phase is reconstructed into the original input vector by the decoder [20]. The input sample set denoted by \(X\) comprises \(N\) groups of samples \(x_{1}\), \(x_{2}\),..., \(x_{n}\). The set of feature vectors in the hidden layer is represented by \(H\), comprising \(M\) groups of samples \(h_{1}\), \(h_{2}\),..., \(h_{m}\). The relationship between \(X\) and \(H\) can be described as follows:  
\[H=s_{\text{f}}(WX+B) \tag{11}\]  
where the weight matrix between the input layer and the hidden layer is denoted by \(W\), while \(B\) represents the bias matrix between these two layers; additionally, \(s_{\text{f}}\) denotes the activation function used by the encoder's neurons, which is typically represented by the sigmoid function. \[s_{\text{f}}(z)= \frac{1}{1+exp(-z)} \tag{12}\]  
where \(z\) represents the vector of input. The decoder operation is the inverse process of the encoder operation, reconstructing the original input from the input vector of the hidden layer's feature vectors. \(Y\) represents the set of the output vectors, which consists of overall \(N\) groups with a dimension of \(n\). Consequently, the coding relationship between \(H\) and \(Y\) can be expressed as follows:  
\[Y=s_{\text{g}}\big{(}W^{\prime}H+B^{\prime}\big{)} \tag{13}\]  
where the weight matrix between the hidden layer and the output layer is denoted by \(W^{\prime}\), while \(B^{\prime}\) represents the bias matrix between these two layers; \(s_{\text{g}}\) represents the activation function of the decoder's neurons. AE accomplishes feature learning through minimizing difference between the reconstructed output data and the original input data, as the following shows:  
\[L(X,Y)=\frac{1}{N}\|X-Y\|^{2} \tag{14}\]  
The gradient descent algorithm is applied to iteratively update the weights and biases of the network in order to minimize the reconstruction error, as illustrated below:  
\[\left\{ \begin{array}{l}\mathbf{W}\leftarrow\mathbf{W}-l\frac{\partial L(X,Y)}{ \partial\mathbf{W}}\\ \mathbf{B}\leftarrow\mathbf{B}-l\frac{\partial L(X,Y)}{\partial\mathbf{B}}\end{array} \right. \tag{15}\]  
where \(l\) is learning rate. However, the learning process of AE may only preserve the information of the original input data, which may not guarantee an effective representation of the feature information. Figure 5: Structure diagram of AE. CAE is based on the original autoencoder by adding a contraction regularization term to the loss function, forcing the encoder to learn a feature extraction function with stronger contraction, thus increasing the robustness when small perturbations occur around the training data sets. Assume that the contraction regularization factor is \(\lambda\). The Jacobi matrix of the hidden layer output with respect to the input samples is \(J_{f}(x)\).