In this recipe, we will develop a four-layer convolutional neural network to improve upon our accuracy in predicting MNIST digits. The first two convolution layers will each be composed of convolution-ReLU-Max Pool operations, and the final two layers will be fully connected layers.
Implementing a simple CNN
Getting ready
To access the MNIST data, TensorFlow has an examples.tutorials package that has great dataset-loading functionalities. After we load the data, we will set up our model variables, create the model, train the model in batches, and then visualize loss, accuracy, and some sample digits.