# A Generative Adversarial Network Structure for Learning with Small Numerical Data Sets
## 3 Methodology
### Virtual Sample Generation and Selection
#### 3.1.4 The Process of Sample Generation with WGAN_MTD  
The steps of the overall trend diffusion technology's operating process, assuming we need to generate a virtual dataset with sample size \(N\) for real data set \(X\) with sample size \(n\), are as follows:  
Step 1: Infer both lower bound \(LB_{j}\) and upper bound \(UB_{j}\) for the jth attribute of \(X\), (said \(X_{j}\)), with Formulas (2)-(5).  
Step 2: Construct a triangular fuzzy membership function (MF), based on Formula (6) and points \(\left\{LB_{j},\;CL_{j},\;UB_{j}\right\}\) shown in Figures 3 and 4, to infer a possible population distribution.  
\[\text{MF}\big{(}x_{ij}\big{)}=\left\{\begin{array}{l l}\frac{x_{ij}-LB_{j}} {CL_{j}-LB_{j}},&x_{i,j}\leq CL_{j}\\ \frac{UB_{j}-x_{i,j}}{UB_{j}-CL_{j}},&x_{i,j}>CL_{j}\end{array}\right. \tag{6}\]  
Step 3: Sample a random seed (rs) from a uniform distribution, U(0, i), map this rs value to the interval \(\left[LB_{j},\;\;UB_{j}\right]\) with Formula (6), and then iteratively generate a set with \(N\) virtual values, \(\left\{v_{i,j}|i=1,2,\ldots,N\right\}\).  
\[v_{i,j}=LB_{j}+r\varsigma\times\left(UB_{j}-LB_{j}\right),\;i=1,2,\ldots,N \tag{7}\]  
Figure 4: The membership function of MTD. The height of \(CL_{j}\) at the midpoint of the data is set to 1 (the highest possibility of this value occurring).  
Step 4: Calculate the membership function values for real data \(\{x_{i_{j}}|i=1,2,\ldots,N\}\) and virtual data \(\{v_{i_{j}}|i=1,2,\ldots,N\}\) with Formula (7), and \(\{\text{MF}(x_{i_{j}})\}\) and \(\text{MF}(v_{i_{j}})\}\), respectively. Augment an attribute with these \(n+N\) membership function values as the additional information for original data \(X\).  
Step 5: For the remaining \(m-1\) attribute values, as input variables, repeat Steps 1 to 4, and produce \(N\) virtual values and the corresponding membership function values; for the \(m\)th attribute value, as the output variable, repeats Step 1 to 3, and skip the step of calculating the membership function.  
Step 6: Based on the assumption of independence between attributes, the \(N\) virtual values of \(m\) attributes generated in Step 5 are randomly combined to generate a set of \(N\) virtual sample data.  
We use WGAN to generate the membership value of MTD, and retore it to the original value through the membership function. The structure of WGAN_MTD's GAN is shown as Figure 2.  
We modified the WGAN by replacing the CNN of Discriminator and Generator with BPN to ensure WGAN_MTD can generate and discriminate the numerical data. Furthermore, we separated the Discriminator loss into the virtual samples' Discriminator loss and the real samples' Discriminator loss, so that the Discriminator can more quickly distinguish between the real and virtual samples.  
In addition to the structure of WGAN, we also modified the MTD technique. [PERSON] et al. [16] noted that although MTD enables the generation of virtual samples and the calculation of their membership value, we cannot identify virtual samples if we only have the membership value, because one membership value will correspond to two original values.  
Therefore, we modified MTD's membership function and formula, as shown in Figure 5. We also changed the activation function of the output layer to the tanh function and added a lambda layer to ensure the end of layer was that same as that of the modified membership function. This helps us to apply MTD to the GAN.