This is merely a jupyter notebook transcription of O'Reilly's course on the subject.
Working with TensorFlow 1.4, I've added some lines to prevent TF from crashing (because of the renew
argument).
The idea is to train a generative adversarial network (GAN) to write convincing digits.