This section explains how the convolutional neural network is built on Keras to identify handwritten images from MNIST.
- For any model development, we need to identify our testing and training datasets as well as the features and the labels. In our case, it is pretty straightforward as the MNIST data from TensorFlow is already broken up into data.train.images for the features and data.train.labels for the labels. Additionally, we want to convert the labels into arrays, so we utilize np.asarray() for ytest and ytrain.
- The arrays for xtrain, xtest, ytrain, and ytest are currently not in the proper shape to be used for a convolutional neural network within Keras. As we identified early on in the chapter, the features for the ...