In the previous section, Training and serving the TensorFlow model through SageMaker, we used the high-level library of TensorFlow to construct a regression model using LinearRegressor. In this section, we will demonstrate how we can construct an actual neural network using the Keras library from TensorFlow. Keras facilitates the design of neural networks by hiding some of the complexity behind the core (that is, low-level) TensorFlow library.
In this chapter, we will use the ubiquitous MNIST dataset that consists of a series of images of handwritten digits along with their real labels (that is, values between 0 and 1). The MNIST dataset can be downloaded from https://www.kaggle.com/c/digit-recognizer/data.
The dataset comes as a CSV file with 784 columns corresponding to each of the pixels in the 28 x 28 image. The values for each...