## 3 Samples Expansion of ITF in PMSM through Cyclic GAN
### Determination of Cycle GAN Hyperparameters  
In establishing the neural networks, hyperparameters are often referred to as adjustment knobs, and their settings will seriously affect the networks' performances and training speeds. At present, the hyperparameters of deep networks are mainly determined based on prior knowledge without detailed experimental proof. This paper uses the trial and error method to optimize the super-parameters of the neural network, including the performance index, neural network structure, activation function, and learning algorithm. Performance Index: For the measurement of network performance, the discriminant network generally uses the accuracy of its discrimination, and the generative network generally uses the quality of its generated samples [24]. For PMSM ITF diagnosis, we use the \(Loss_{Generator}\) to evaluate the quality of the motor samples generated by the generator. We use the \(Loss_{Discriminator}\) to evaluate the discriminant results' accuracy and measure the network performance of Cycle GAN. Activation Function: As mentioned above, the calculation of each neuron node can be divided into a linear calculation and a nonlinear calculation. Among them, the nonlinear calculation is undertaken by the activation function [25]. Therefore, more attention should be paid to selecting activation functions when building the network model. The LeakyRelu activation function inherits the partial linearity of the Relu activation function and avoids the problem that the Relu activation function does not adequately map negative input. The function and its derivative are shown in Equation (18)  
\[\left\{ \begin{array}{l}\sigma(z)=\left\{\begin{array}{l}z,z>0\\ \alpha z,z\leq 0\end{array}\right.\\ \\ d\sigma(z)=\left\{\begin{array}{l}1,z>0\\ \alpha,z\leq 0\end{array}\right.\end{array} \right. \tag{18}\]  
where \(\alpha\) is a small number by default, usually 0.1. It can also be adjusted according to specific needs. The Tanh activation function is the abbreviation of the hyperbolic tangent function. It looks like an original Logistic activation function, but the difference is that its image center point is at (0, 0) instead of (0, 0.5). Compared with the original Logistic activation function, the Tanh activation function can also handle negative value input well. The function and its derivative are shown in Equation (19). \[\left\{ \begin{array}{l}\sigma(z)=\frac{e^{z}-e^{-z}}{e^{z}+e^{-z}}\\ d\sigma(z)=1-\left(\frac{e^{z}-e^{-z}}{e^{z}+e^{-z}}\right)^{2}\end{array} \right. \tag{19}\]  
It can be seen from the image that the output range of the Tanh activation function is \((-1,1)\), the change rate is significant near 0, and  
\[\left\{ \begin{array}{l}\underset{z\rightarrow-\infty}{\lim}\sigma(z)=1\\ \underset{z\rightarrow-\infty}{\lim}\sigma(z)=-1\end{array} \right. \tag{20}\]  
For the PMSM ITF studied in this paper, LeakyRelu is selected as the activation function of the hidden layer, and Tanh is selected as the activation function of the output layer. LeakyRelu and Tanh are used as activation functions in this paper, and their function images are shown in Figure 5.  
Theoretically, the more layers of neural networks and the deeper the network structure, the stronger the learning ability to acquire data features; however, overfitting is a problem to be considered in the construction and training processes. Some network structures perform well in the training set, but the changes in the test set are not satisfactory. In order to avoid the influence of overfitting, this part verifies the network structure of different combinations. It analyzes the decline in the loss function of each combination in the training set and its performance in the test set to determine the best network structure. Table 1 shows several suitable network structures of the generator and the discriminator. The structures with poor performance will not be shown. There are 16 combinations in total. The whole dataset includes PMSM three-phase stator current data under a healthy state and under ITFs of different degrees.