Week1: Fundations of Convolutional Neural Networks
1. Convolution on 2D images
- input:
- padding填充:
- stride步长:
- kernel: (must be odd !)
- output:(向下取整)
1.1 valid convolution有效卷积
- input:
- padding填充:
- stride步长:
- kernel: (must be odd !)
- output:
1.2 same convolution相同卷积
- input:
- padding填充:
- stride步长:
- kernel: (must be odd !)
- output:
2. Convolution vs.cross-correlation卷积vs互相关函数
-
目前我们理解的卷积,其实叫做互相关函数(cross-correlation),其公式描述如下:
-
数学中卷积的定义与我们正在目前理解的图像卷积不同,其对核进行了翻转(flip),即将核分别沿水平轴和竖直轴翻转一次(注意不是转置),其公式描述如下:
-
对核进行翻转的唯一目的是实现可交换性,即式(2)与下式(3)等价:
-
在神经网络中,可交换性不是重要的性质,因此,在神经网络中,这两种运算都称为卷积。
3. Convolution on RGB images
4. One layer of a convolutional network
5. Summary of notation
If layer is a convolution layer:
- input: (Highth*Width*Channel)
- output:
- 其中:
number of filters
filter size
padding
stride - Each filter is
- Activations:
- Weights:
- Bias:
6. Example of ConvNet
7. Types of layers in a convolutional network:
- Convolution(CONV)
- Polling(POOL)
- Fully connected(FC)
8. Pooling Layers池化层
- 池化函数使用某一位置的相邻输出的总体统计特征来代替网络在该位置的输出,如最大池化、平均池化等
- 池化函数是固定的,不需要通过学习来获得
- 池化层可以极大的提高网络的效率
- 可调参数:
- filter size
- stride
- Pooling type: Max or average
- padding (rarely used)
- input:
- output:
9.CNN example
- 随着网络深度的增加,层的高度和宽度在不断减小,通道数在不断增加;
- 随着网络深度的增加,层的总体元素个数(Activation Size)在不断减小;
- 卷积层(CONV)的学习参数要小于全连接层(FC)的学习参数;
10. Why convolutions?
- 稀疏交互Sparse interactions
- 参数共享Parameter sharing