In a fully connected neural network, every unit in a layer receives input from every unit in the preceding layer. A small network can classify images after each image is flattened into a vector. section 10.3
Figure 10.21 The architecture that we will use to classify our dataset. It contains two hidden layers: one of 128 and one of 64 nodes. The activation function between them is a ReLU, and the final activation function is a softmax.
This classifier has two hidden layers, with 128 and 64 units, followed by a two-class output layer. section 10.3
Classifying handwritten digits
For MNIST, each 28-by-28 image is reshaped into a vector, and each label is encoded as a vector of 10 values. A network with 128- and 64-unit hidden layers predicts one of 10 digits. Its testing accuracy is 0.942; one shown error is a handwritten 3 classified as an 8. section 10.3
Flattening an image loses information about its layout. Fully connected networks can work well on simple image tasks, but more complex images call for other architectures, such as convolutional neural networks. section 10.5

