This is the pytorch implementation of Bidirectional GAN(BiGAN). Unlike ordinary GANs which are focused on generating data, the Bidirectional GAN is focused on creating an embedding of the original data. The model has an additional "Encoder" Structure from the original GAN which helps to encode original data. The descriminator will then discriminate the joint distribution of the latent vector and original data. The paper theoretically proves that the latent embedding will become an inverse mapping of the original input data when trained properly.
There are not many, but a few, references for BiGAN. However, I wasn't able to find a pytorch version and without a convolutional structure. My codes are implemented in MLP style where the image is flattened. The model structure were referenced from this great github repo. However, I made some minor adjustments as the implemented model struck on mode collapse.
Main dependencies (with python=3.6)
pytorch = 1.6.0
torchvision = 0.7.0
pip install requirements.txt
python main.py