A convolutional layer (sometimes referred to in the literature as "filter") is a particular type of neural network that manipulates the image to highlight certain features. Before we get into the details, let's introduce a convolutional filter using some code and some examples. This will make the intuition simpler and will make understanding the theory easier. To do this we can use the
keras datasets, which makes it easy to load the data.
We will import
numpy, then the
mnist dataset, and
matplotlib to show the data:
import numpy from keras.datasets import mnist import matplotlib.pyplot as plt import matplotlib.cm as cm
Let's define our main function that takes in an integer, corresponding to the image in the
mnist dataset, and ...