Using neural networks to classify handwritten digits
The "hello world" of deep learning is training a model that can classify handwritten digits. That's just what you'll do in this section. It will only require a couple of lines of code to implement with the TensorFlow library.
Before you can proceed, you'll have to install TensorFlow. The process is a bit different depending on whether you're on Windows, macOS, or Linux, and whether you have a CUDA-compatible GPU or not. You can refer to the official installation instructions: https://www.tensorflow.org/install. The rest of this section assumes you have TensorFlow 2.x installed. Here are the steps to follow:
- To start, you'll have to import the TensorFlow library along with some additional modules. The
datasets
module enables you to download data straight from the notebook. Thelayers
andmodels
modules will be used later to design the architecture of the neural network.Here's the...