# Multi-Output Regression with Generative Adversarial Networks (MOR-GANs)
## 3 Results from Synthetic Datasets
### Multi-Output Regression with MOR-GAN
#### 3.4.2 Co-Varying Spiral Dataset  
In many applications, variables often co-vary, in other words, a change in one variable is typically reflected by a change in another variable. In this work, we use a two dimensional spirals dataset as a benchmark to compare the capability of both GAN and WGAN. \(x\) and \(y\) are the variables that define the spiral at 20 different \(z\) levels which are equally spaced with \(z\in[0,4]\). Thus there are 20 pairs of \(x,y\) coordinates as the output of the MOR-GAN.  
The structure of the model and the hyperparameters of each layer used in this section are displayed in Figures 18 and 19, and Table 3.  
Figure 16: The eye generated by the WGAN (**left**) and the comparison between the real data and the generated data (**right**) using the constrained input method described in Algorithm 1.  
Figure 17: The rotated eye predicted using Algorithm 1 (**left**) and the comparison between the real rotated data and the predicted data (**right**).  
Figure 15: The structure of the discriminator for the eye dataset.  
The three-dimensional spiral curves dataset is generated based on the equations below:  
\[x = r\sin\theta, \tag{9}\] \[y = r\cos\theta,\] (10) \[z = 4\left(\frac{\theta-a}{b-a}\right), \tag{11}\]  
where \(\theta\in[a,b]\), \(a=4\pi x_{1}-2\pi\) and \(b=4\pi x_{2}+2\pi\) for \(x_{1},x_{2}\) chosen randomly from the unit interval, and the radius \(r\) is chosen randomly from the interval \([0.6,1]\). For each spiral, \(r\), \(x_{1}\) and \(x_{2}\) are chosen at random, and 20 equally-spaced values for \(\theta\) are chosen from the interval \([a,b]\) to generate the curves shown in Figure 20.  
Figure 20 shows the predictions made by the MOR-GAN. The first 10 data points in the spiral, shown as solid blue dots, are used to predict the next 10 data points in the spiral, produced by constraining the output using Algorithm 1. The real spiral is given by the blue line and the spiral generated by the algorithm constraining the first 10 samples is given by the red line. Three different sizes of latent spaces are used and it can be observed that all latent spaces give reasonable reconstructions of the real spirals, therefore demonstrating that the reconstruction reliability of the shape of the curve does not vary much with the increasing dimension of latent space. Figure 20 also shows that the MOR-GAN can learn the structure of the input data and can recreate the shapes (which are spirals in this case) with approximate distributions (which are annular distributions representing the start of the spirals in this case).  
\begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Layer** & **Kernel Size** & **Strides** & **Padding** & **Use Bias** \\ \hline Conv2D\_1 & \((8,2)\) & \((1,2)\) & same & True \\ \hline Conv2D\_2 & \((8,2)\) & \((2,1)\) & same & True \\ \hline Conv2D\_transpose\_1 & \((8,2)\) & \((1,2)\) & same & False \\ \hline Conv2D\_transpose\_2 & \((8,2)\) & \((2,1)\) & same & False \\ \hline Conv2D\_transpose\_3 & \((8,2)\) & \((2,1)\) & same & False \\ \hline Conv2D\_3 & \((8,2)\) & \((2,1)\) & same & True \\ \hline Conv2D\_4 & \((8,2)\) & \((2,1)\) & same & True \\ \hline \hline \end{tabular}
\end{table}
Table 3: Hyperparameters used in the construction of the convolutional neural network.  
Figure 19: The structure of the discriminator for the Co-Varying Spiral problem.  
Figure 18: The structure of the generator for the Co-Varying Spiral problem.  
Figure 20: The figures above show the generated data using the prediction function on real samples (rows 1, 3, 5) and test samples (rows 2, 4, 6) when the size of the latent space is \(3,6\) and \(12\) respectively. The blue lines indicate the real spiral, the solid blue dots show the \(10\) data points that are constrained using Algorithm 1 and the red lines show the spiral produced by the generator for these \(10\) constrained points.