Hands-On Neural Networks with Keras
上QQ阅读APP看书,第一时间看更新

Making some imports

So, let's get started, shall we? We will perform some simple experiments by leveraging all the concepts we have learned about in the previous chapters, and perhaps also encounter some new ones while on the job. We will use Keras, as well as the TensorFlow API, allowing us to also explore the eager execution paradigm. Our first task will be to implement a simple version of the multi-layered perceptron. This version is known as the feedforward neural network, and is a basic architecture that we can use to further explore some simple image classification examples. Obeying customary deep learning tradition, we will begin our first classification task by using the MNIST dataset for handwritten digits. This dataset has 70,000 grayscale images of digits between 0 and 9. The large size of this dataset is ideal, as machines require about 5,000 images per class to be able to come close to human-level performance at visual recognition tasks. The following code imports the libraries we will be using:

import numpy as np
import keras
from keras.datasets import mnist
from keras.utils import np_utils