Generated Adversarial Networks(GANs) are an approach to generative modeling using deep learning methods like CNNs or RNNs.
This technique mainly revolves around two models, namely:
1)the Generating model
2)the Discriminating model
In this particular case, the generating model will be taking a point in latent space, which is a randomly generated 100 element vector in this particular case and gives out an (28,28,1) sized vecor of pixel intensities.
The discriminating model on the other hand takes the (28,28,1) sized vector which is given by the generating model and determines whether the generated image is fake or real. Where fake in this case means that the image generated by the generating model is not a number and real means the image generated is a number.
The composite model here is the combination of the generating model and the discriminating model.
As you can notice here the input that is being taken is a randomised array of 100 elements and the output is a single integer 1 or 0 which determines whether the image generated is a number or not. And also the parameters of the discriminating model in the composite model are non-trainable
Here the Generating model and the Discriminating model are trained simultaneously. First, the discriminating model is trained seperately, then the parameter are update based on based on the loss from the discriminating model. After that, based on the current discriminating model the generating model is trained. This training may take a couple of hours on a CPU. But the same training will be done in a couple of minutes.
As you can notice the images are not exactly numbers but are centered pretty well.
The numbers are still kinda edgy but we are getting somewhere.
As you can notice, a few numbers can be identified and the edginess of the previous images has decreased by a great extent
This training could be taken further and the numbers could be made a little more identifiable, but there will exist a point where the accuracy of distinctable numbers will be flatlined and cannot be increased further.