# Pool层及其公式推导

${a}^{l-1}=\sigma \left({z}^{l-1}\right)$$a^{l-1}=\sigma(z^{l-1})$

### 前向传播

#### maxpool

${a}_{ij}^{l}=max\left({a}_{mn}^{l-1}\right),i\le m,n\le i+2其中m,n为{a}_{ij}^{l-1}对应的pool核覆盖的区域,如下左图{a}_{00}对应区域为红框所标记的区域$

### 反向传播

#### maxpool

${\delta }_{k,v}^{l-1}=\frac{\mathrm{\partial }C}{\mathrm{\partial }{z}_{k,v}^{l-1}}=\sum _{ij}^{i=3,j=3}\frac{\mathrm{\partial }C}{\mathrm{\partial }{a}_{ij}^{l}}\frac{\mathrm{\partial }{a}_{ij}^{l}}{\mathrm{\partial }{a}_{k,v}^{l-1}}\frac{{a}_{k,v}^{l-1}}{\mathrm{\partial }{z}_{k,v}^{l-1}}$

${a}_{ij}^{l}=max\left({a}_{mn}^{l-1}\right)={a}_{{i}_{max},{j}_{max}}^{l-1},{i}_{max},{j}_{max}代表{a}_{ij}^{l}对应的pool核区域最大的那个元素的索引$

${\delta }_{k,v}^{l-1}=\sum _{ij}^{i=3,j=3}\left\{\left[\left(k={i}_{max},v={j}_{max}\right)?\left(\frac{\mathrm{\partial }C}{\mathrm{\partial }{a}_{ij}^{l}}\frac{\mathrm{\partial }{a}_{ij}^{l}}{\mathrm{\partial }{z}_{{i}_{max},{j}_{max}}^{l-1}}\right):0\right]\frac{{a}_{k,v}^{l-1}}{\mathrm{\partial }{z}_{k,v}^{l-1}}\right\}=\sum _{ij}^{i=3,j=3}\left\{\left(k={i}_{max},v={j}_{max}\right)?\frac{\mathrm{\partial }C}{\mathrm{\partial }{a}_{ij}^{l}}:0\right]{\sigma }^{\prime }\left({z}_{k,v}^{l-1}\right)\right\}$

$\begin{array}{rl}& {p}_{10}=\left({\delta }_{00}+{\delta }_{01}+{\delta }_{10}+{\delta }_{20}+{\delta }_{21}\right){\sigma }^{\prime }\left({z}_{10}^{l-1}\right)\\ & {p}_{02}={\delta }_{02}+{\delta }_{03}{\sigma }^{\prime }\left({z}_{02}^{l-1}\right)\\ & {p}_{22}={\delta }_{11}+{\delta }_{12}+{\delta }_{13}+{\delta }_{22}+{\delta }_{23}+{\delta }_{31}+{\delta }_{32}+{\delta }_{33}{\sigma }^{\prime }\left({z}_{22}^{l-1}\right)\\ & {p}_{30}={\delta }_{30}{\sigma }^{\prime }\left({z}_{30}^{l-1}\right)\end{array}$

#### avg pool

${a}_{i,j}^{l}={z}_{i,j}^{l}={a}_{{i}_{max},{j}_{max}}^{l}$$a_{i,j}^l=z_{i,j}^l=a_{i_{max},j_{max}}^l$

${\delta }_{k,v}^{l-1}=\sum _{ij}^{i=2,j=2}\frac{\mathrm{\partial }C}{\mathrm{\partial }{a}_{ij}^{l}}\frac{\mathrm{\partial }{a}_{ij}^{l}}{\mathrm{\partial }{a}_{k,v}^{l-1}}\frac{\mathrm{\partial }{a}_{k,v}^{l-1}}{\mathrm{\partial }{z}_{k,v}^{l-1}}$

$\begin{array}{rl}& {\delta }_{00}^{l-1}=\frac{1}{9}{\delta }_{00}^{l}{\sigma }^{\prime }\left({z}_{00}^{l-1}\right)\\ & {\delta }_{01}^{l-1}=\frac{1}{9}{\delta }_{00}^{l}{\sigma }^{\prime }\left({z}_{01}^{l-1}\right)+\frac{1}{9}{\delta }_{01}{\sigma }^{\prime }\left({z}_{01}^{l-1}\right)\\ ...\\ & {\delta }_{33}^{l-1}=\frac{1}{9}{\delta }_{33}^{l}{\sigma }^{\prime }\left({z}_{33}^{l-1}\right)\end{array}$

• 广告
• 抄袭
• 版权
• 政治
• 色情
• 无意义
• 其他

120