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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.