In this video, we'll discuss the convolutional
neural network with respect to MNIST.
So, we'll have our convolutional neural network
class.
In the class constructor, we'll have 16 output
channels for the first layer, and 32 output
channels for the second layer.
And you can use your own... and as they are
variables, you can use your own number of channels
when you construct your own object.
So, we have the first convolutional layer we have
a kernel size of 5 and a kernel size of 2.
And we have the second convolutional layer
and we have a kernel size of 5 and a kernel size of 2.
And then we'll use the output to our linear
layer.
And just to note, if you adjust any of the
parameters with respect to kernel size, you'll
have to adjust these numbers and these might
take a little more work, but you can try a
different output, but you can change out1
and out2, you have a lot more flexibility
in choosing out1 and out2.
So, let's examine this linear object before.
So, for each channel, 7 by 7 activation, and
if we use our default value of out2 equals
32, we'll have total of 32 channels.
So, we want to input this into a linear layer,
in this case, and as such we'll have 32 for
every channel times 7 by 7 for each of the
activation maps and we'll input that to
our linear layer.
So, there are first 16 convolutional kernels.
And for our second layer we'll have 16 inputs
and 32 outputs.
And just to note, red is larger than blue
in these images.
So, let's simplify that with our little diagram, alright.
So, it's very similar to the original diagram,
except there's a lot more kernels.
So, we look at our activation and pooling
layer, and our activation and pooling layer.
So, let's look at the activation map for the
first convolutional layer; and it's that guy over there.
So, let's look at the output of the activations
for the different kernels.
So, if you look at our first kernel, and if you look
at the output for all the channels, we see
that these ones are relatively large.
If we look at the 7 we see they look pretty
similar, except for these activation maps
over there, they seem to have larger values
compared to the 1.
So, here are our convolutional layers, and
we'll have 32 outputs, and just to note,
I couldn't fit all the outputs in one slide.
Let's squeeze them all together and look at
the outputs combined, activation map, and
the output after we apply the activation function
for the 1, and similar for the 7.
So, let's compare them side-by-side.
So, let's compare them side-by-side and if
you look at the output of these activations,
we see that the 7 has a lot more in this region.
These activations are looking at different
parts of the image.
And that's it!
