PyTorch implementation of Generative Adversarial Networks by Ian Goodfellow et al. on the MNIST dataset.
The training of the generator and discriminator networks is based on the following MiniMax game played between the two.
The training algorithm is described in the paper as below.
Binary Cross Entropy loss was used to train both generator and discriminator. Generator was trained my maximising discriminators probability of being real on fake data instead of other way round, because as mentioned in the paper, it provides stronger gradients early.
The generator model file is available. Load it like this
import torch
...
model = Generator()
state = torch.load('mnist_generator.pth')
model.load_state_dict(state)
model.eval()
...