# Survey on Implementations of Generative Adversarial Networks for Semi-Supervised Learning
## 3 Literature Review of GANS for SSL
### Encoder-Based Approaches  
The encoder-based approach was first presented as part of BiGAN [38], where the authors argued that while GANs were effective at taking a latent space and generating data, there was no technique for GANs to project the data back into the latent space. Therefore, they proposed an approach where an encoder was included as part of the GAN architecture to generate a latent space mapping from the input data. The architecture of the BiGAN model is shown in Figure 3.  
Figure 3: The BiGAN Architecture.  
The adopted approach involved the discriminator receiving a pair of latent space mapping and data as input wherein it discriminated jointly the data and latent space with the latent component either being the generator input \(z\) or the encoder output E(x). The training objective for this architecture is shown in Equation (3).  
\[\min_{G,E}\max_{D}\mathrm{E}_{x\sim p_{x}}\underbrace{\left[\mathrm{E}_{z\sim p _{E}(:|x)}[\log D(x,z)]\right]}_{\log D(x,E(x))}+\mathrm{E}_{z\sim p_{z}} \underbrace{\left[\mathrm{E}_{x\sim p_{G}(:|z)}[\log(1-D(x,z))]\right]}_{\log \left(1-D(G(z),z)\right)} \tag{3}\]  
Adversarially learned inference (ALI) [39] also used an encoder that authors referred to as an \"inference machine\" that encodes training samples to the latent space, along with a discriminator that is trained to discriminate on the basis of joint samples consisting of the data and the corresponding latent variable. In this architecture, the generator acted as a decoder in mapping a latent distribution to the data distribution. The authors demonstrated the algorithm's utility for semi-supervised classification by leveraging the inference machine instead of the discriminator. In their experiments, they were able to train ALI in an unsupervised manner on labeled as well as on unlabeled data, and then train an Support Vector Machine (SVM) as a classifier for the latent encodings on a subset of the labeled data. Thus, using such a technique, the authors were able to demonstrate the utility of an adversarial approach for SSL.  
The success of these techniques has resulted in a wider implementation of the bidirectional architecture. [PERSON] et al. [40] proposed an \"Augmented BiGAN\" model inspired from the BiGAN and the ALI models. They argued that since the trained GANs produced realistic images, it could be assumed that the generator obtained the tangent space of an image's manifold. Therefore, they leveraged these tangents to inject desirable invariances into the classifier to improve its performance. This is in contrast to techniques that apply assumed invariances such as rotating and flipping. Furthermore, they proposed an improvement to the encoder presented by BiGAN that they claimed caused \"class switching\", which is when the generated data from an encoded latent space is of a different class to the original data. Therefore, they proposed a third input pair to feed to the discriminator consisting of a latent space derived from encoding a data point and the result of passing that encoded space through the generator. This pair would also be labeled as fake, and an additional loss term would be added to complement this change. Using such an approach, the authors reported a quantitative as well as qualitative improvement in performance as compared to BiGAN.