Search⌘ K

Logits

Explore how to generate per-class logits within CNNs by applying global average pooling instead of fully-connected layers. Learn the benefits of this approach, including its native integration with CNN structures and reduced risk of overfitting. Practice implementing TensorFlow functions to complete your model's final layers.

Chapter Goals:

  • Learn about global average pooling and its benefits
  • Obtain the per class model logits

A. Channel-based logits

In the CNN section, we applied flattening and a couple of fully-connected layers (with dropout) to obtain our model's logits. However, rather than flattening our data, we can instead use a convolution layer to convert the number of channels in our data to the number of image classes (categories). Then, we apply a special type of average pooling layer to obtain logits for each channel (i.e. image class).

B. Global average pooling

Average pooling follows the exact same concept as max pooling, with the only difference being that the filter performs an average rather than a ...