参数重要性:
学习率 α \alpha α > (hidden units/batch_size) > 学习率衰减因子/网络层数 > β 1 ( 0.9 ) , β 2 ( 0.999 ) , ϵ ( 1 0 − 8 ) \beta_1(0.9), \beta_2(0.999),\epsilon(10^{-8}) β1(0.9),β2(0.999),ϵ(10−8)
随机调参要比网格调参效果更好。
合理选择超参数范围以及参数的尺度:
我们把网络中间层在训练过程中,数据分布的改变称之为:“Internal Covariate Shift”。
除了输入层的数据外(因为输入层数据,我们已经人为的为每个样本归一化),后面网络每一层的输入数据分布是一直在发生变化的,因为在训练的时候,前面层训练参数的更新将导致后面层输入数据分布的变化。
论文定义: 在深层网络训练的过程中,由于网络中参数变化而引起内部结点数据分布发生变化的这一过程被称作Internal Covariate Shift。
简而言之,每个神经元的输入数据不再是“独立同分布”。
输入: B = x 1... m B = {x_{1...m}} B=x1...m (x over mini-batch); β , γ \beta, \gamma β,γ (Parameters)
输出: y i = B N γ , β ( x i ) {y_i = BN_{γ,β}(x_i)} yi=BNγ,β(xi)
μ B ← 1 m ∑ i = 1 m x i σ B 2 ← 1 m ∑ i = 1 m ( x i − μ B ) 2 x ^ i ← x i − μ B σ B 2 + ϵ y i ← γ x ^ i + β ≡ BN γ , β ( x i ) \begin{aligned} \mu_{\mathcal{B}} & \leftarrow \frac{1}{m} \sum_{i=1}^{m} x_{i} \\ \sigma_{\mathcal{B}}^{2} & \leftarrow \frac{1}{m} \sum_{i=1}^{m}\left(x_{i}-\mu_{\mathcal{B}}\right)^{2} \\ \widehat{x}_{i} & \leftarrow \frac{x_{i}-\mu_{\mathcal{B}}}{\sqrt{\sigma_{\mathcal{B}}^{2}+\epsilon}} \\ y_{i} & \leftarrow \gamma \widehat{x}_{i}+\beta \equiv \operatorname{BN}_{\gamma, \beta}\left(x_{i}\right) \end{aligned} μBσB2x iyi←m1i=1∑mxi←m1i=1∑m(xi−μB)2←σB2+ϵxi−μB←γx i+β≡BNγ,β(xi)
通过数据分布: 让每一层网络的输入数据分布都变得稳定,但却导致了数据表达能力的缺失;
上述算法的最后一步,可以恢复数据本身的表达能力。
权重伸缩不变性: Norm ( W ′ x ) = Norm ( W x ) \operatorname{Norm}\left(\mathbf{W}^{\prime} \mathbf{x}\right)=\operatorname{Norm}(\mathbf{W} \mathbf{x}) Norm(W′x)=Norm(Wx) ; W ′ = λ W \mathbf{W}^{\prime}=\lambda \mathbf{W} W′=λW
数据伸缩不变性: Norm ( W x ′ ) = Norm ( W x ) \operatorname{Norm}\left(\mathbf{W} \mathbf{x}^{\prime}\right)=\operatorname{Norm}(\mathbf{W} \mathbf{x}) Norm(Wx′)=Norm(Wx) ; x ′ = λ x \mathbf{x}^{\prime}=\lambda \mathbf{x} x′=λx
数据伸缩不变性可以有效地减少梯度弥散,简化对参数(学习率)的选择。
可以用指数加权平均来追踪训练数据中每一个Batch的均值和方差。也可以根据每个Mini-Batch的均值和方差求全局统计量:
u t e s t = E ( u b a t c h ) u_{test} = E(u_{batch}) utest=E(ubatch)
σ t e s t 2 = m m − 1 E ( σ b a t c h 2 ) \sigma ^2_{test} = \frac{m}{m-1} E(\sigma ^2_{batch} ) σtest2=m−1mE(σbatch2)
详解深度学习中的Normalization,BN/LN/WN
Batch Normalization原理与实战
深度学习中 Batch Normalization为什么效果好
Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
第三周 超参数调试、Batch正则化和程序框架(Hyperparameter tuning)
【深度学习】深入理解Batch Normalization批标准化
Must Know Tips/Tricks in Deep Neural Networks (by Xiu-Shen Wei)