Logits layer

Finally, we need the logits layer, which will take the output of the fully connected layer and then produce the raw prediction values. For example, in the case of the digit classification, the output will be a tensor of 10 values, where each value represents the score of one class from 0-9. So, let's define this logit layer for the digit classification example, where we need 10 outputs only, and with linear activation, which is the default for the dense() function of TensorFlow:

logits_layer = tf.layers.dense(inputs=dense_layer, units=10)
Figure 9.10: Training the ConvNet

The final output of this logits layer will be a tensor ...

Get Deep Learning By Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.