Skip to Content
Hands-On Convolutional Neural Networks with TensorFlow
book

Hands-On Convolutional Neural Networks with TensorFlow

by Iffat Zafar, Giounona Tzanidou, Richard Burton, Nimesh Patel, Leonardo Araujo
August 2018
Intermediate to advanced
272 pages
7h 2m
English
Packt Publishing
Content preview from Hands-On Convolutional Neural Networks with TensorFlow

Converting convolution layers into fully connected layers

Actually, we can consider fully connected layers as a subset of convolution layers. It’s possible to convert a CNN layer into a fully connected layer if we set the kernel size to match the input size. Setting the number of filters is then the same as setting the number of output neurons in a fully connected layer. Check for yourself that in this case, the operations will be the same.

Example:

Consider an FC layer with 4,096 output neurons and input of size 7x7x512, the conversion would be:

Conv layer: Kernel:7x7, Pad:0, Stride:1, Filters:4,096.

Using the formula to calculate output size, we get an output of size 1 x 1 x 4096.

One of the main reason for doing this is so that your network ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Computer Vision Using Deep Learning: Neural Network Architectures with Python and Keras

Computer Vision Using Deep Learning: Neural Network Architectures with Python and Keras

Vaibhav Verdhan

Publisher Resources

ISBN: 9781789130331Supplemental Content