/GAN-tutorial

Primary LanguageJupyter Notebook

This notebook consists of an example code for building a basic GAN using CNN based generator and discrimator networks. It is mostly inspired by a tutorial available on askpython website. The hyperparameters or the complexity of the architecture were not optimized for the given dataset - Fashion MNIST. Also, the number of epochs was not optimal either. With the only purpose of understanding, this GAN was built using PyTorch library and uses batch normalization, convolutions, transposed convolutions, and two types of activations - tanh, LeakyReLU.

Binary cross-entropy with logits is used to build losses for discriminator (D) and generator (G). G-loss is given by fraction of successful fake detection by D for randomly generated signals by G. D-loss has two parts which are averaged - loss from successful classification of fake signals generated by G and loss from successful classification of real signals given by the dataset.