Deep Learnig(CNN基础)

1.链式反向梯度求导

(1)链式法则计算

y=f(x),z=g(y)zx=zyyx\begin{aligned} &y=f(x), z=g(y)\\ &\frac{\partial z}{\partial x}=\frac{\partial z}{\partial y} \cdot \frac{\partial y}{\partial x} \end{aligned}

(2)神经网络中链式法则

Deep Learnig(CNN基础)

(3)链式法则举例

   链式法则:fx=fqqx\frac{\partial f}{\partial x}=\frac{\partial f}{\partial q} * \frac{\partial q}{\partial x}
f(x,y,z)=(x+y)zf(x, y, z)=(x+y) * z
   目标:fx,fy,fz\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z}
Deep Learnig(CNN基础)

(4)前向后向算法举例

   目标:
f(x,y,w)=1exp{[(x1+x2)w+max(y1,y2)]}f(x, y, w)=\frac{1}{\exp \left\{-\left[\left(x_{1}+x_{2}\right) w+\max \left(y_{1}, y_{2}\right)\right]\right\}}
   前向算法:
Deep Learnig(CNN基础)
   后向算法:
      目标:fx1,fx2,fw,fy1,fy2\frac{\partial f}{\partial x_{1}}, \frac{\partial f}{\partial x_{2}}, \frac{\partial f}{\partial w}, \frac{\partial f}{\partial y_{1}}, \frac{\partial f}{\partial y_{2}}
      链式法则:fx=fqqx\frac{\partial f}{\partial x}=\frac{\partial f}{\partial q} * \frac{\partial q}{\partial x}
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)

(5)神经网络中链式法则

   计算顺序:从loss向输入传播
   导数存储:每层的导数(Δy,Δx)(\Delta y, \Delta x)结果进行存储,用于下一层导数的计算。

2.卷积神经网络-卷积层

(1)卷积层

   它是卷积神经网络基本结构,由多个卷积核组合形成,每个卷积核同输入数据卷积运算,形成新的特征图。

(2)卷积核

   同输入数据进行的二维(一维,三维)算子,大小由用户定义,深度输入数据定义,卷积核矩阵值:卷积神经完了过的参数,卷积核初值随机生成,通过反向传播更新。
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)

(3)卷积核组合方式:卷积层-特征图

Deep Learnig(CNN基础)

(4)卷积层-关键参数

   卷积核大小:
      奇偶选择:一般奇数,满足对称;
      大小选择:根据输入数据,根据图像特征;
      厚度确定:与输入数据一致;
      覆盖范围:一般覆盖全部输入,特征情况覆盖局部区域。
   步长:对输入特征图的扫描间隔,对输出特征图的影响
Deep Learnig(CNN基础)
   边界扩充:在卷积计算过程中,为了允许边界上的数据也能作为中心参与卷积运算,将边界假装延申。
Deep Learnig(CNN基础)
   卷积核数目:卷积神经网络的宽度,常见参数64,128,256,GPU并行更加高效。
   卷积网络参数计算:Num:3×3×m×n3 \times 3 \times m \times n
Deep Learnig(CNN基础)
   正向传播:
Deep Learnig(CNN基础)
   反向传播:
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)
Deep Learnig(CNN基础)

3.卷积神经网络-功能层

(1)非线性激励层:

   卷积是线性函数,增加非线性描述能力。
Deep Learnig(CNN基础)

(2)池化层

   数据降维,方便计算和存储,池化过程中,每张特征图单独降维。
Deep Learnig(CNN基础)

(3)归一化层

   特证数Scale不一致,加速训练,提升精度。
Deep Learnig(CNN基础)

(4)切分层

Deep Learnig(CNN基础)

(5)融合层

Deep Learnig(CNN基础)
Deep Learnig(CNN基础)