Shared weights and bias
Let's suppose that we want to move away from the pixel representation in a row by gaining the ability to detect the same feature independently from the location where it is placed in the input image. A simple intuition is to use the same set of weights and bias for all the neurons in the hidden layers. In this way, each layer will learn a set of position-independent latent features derived from the image.
Assuming that the input image has shape (256, 256) on three channels with tf (TensorFlow) ordering, this is represented as (256, 256, 3). Note that with th (Theano) mode, the channel's dimension (the depth) is at index 1; in tf (TensoFlow) mode, it is at index 3.
In Keras, if we want to add a convolutional layer with ...
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.
Read now
Unlock full access