An output layer is the final layer of a neural network. It converts the work of the hidden layers into the model’s predictions. section 10.8
Choose the output layer according to the prediction task:
- For two-class classification, use two output nodes with a softmax activation and represent labels as two-column categorical vectors. section 10.18
- For numerical regression, use one output node with no activation function, allowing the network to predict any numerical value. section 10.20
- Treat the output size as the number of non-bias nodes in the final layer. section 10.8
Two tasks, two output designs
A circular dataset uses two hidden layers followed by Dense(2, activation='softmax'), producing class probabilities. A house-price model ends with Dense(1), producing a numerical prediction and training with mean squared error. section 10.18 section 10.20
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.
Use the architecture diagram to see how hidden layers feed into a final softmax output layer. section 10.18






