天天看點

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

學習筆記,僅供參考,有錯必糾

文章目錄

  • ​​Understanding the difficulty of training deep feedforward neural networks​​
  • ​​Abstract​​
  • ​​Deep Neural Networks​​
  • ​​Experimental Setting and Datasets​​
  • ​​Online Learning on an Infinite Dataset Shapeset-3*2​​
  • ​​Finite Datasets​​
  • ​​Experimental Setting​​
  • ​​Effect of Activation Functions and Saturation During Training​​
  • ​​Experiments with the Sigmoid​​
  • ​​Experiments with the Hyperbolic tangent​​
  • ​​Studying Gradients and their Propagation​​
  • ​​對比​​
  • ​​Error Curves and Conclusions​​
  • ​​參考文獻(本部落格)​​

Understanding the difficulty of training deep feedforward neural networks

Abstract

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

基于随機初始化的标準梯度下降法在深度神經網絡中表現的不好.

由于随機初始化的均值問題,sigmoid激活函數并不适合深度神經網絡,其top隐藏層(最接近輸出層的隐藏層)會出現飽和的狀态.

  • 飽和狀态

當x的數值處于兩個紅框框住的狀态時,sigmoid函數的梯度幾乎為0,參數的變化率非常小,此時就是處于sigmoid函數的【飽和狀态】.

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

注意,當x值為0時,函數接近于線性變化,函數隻能做出近似線性的表達,則對非線性的情況不能很好的拟合,此時效果也不是很好. 當x的數值處于綠色框的範圍内時,會有較好的效果.

Deep Neural Networks

Experimental Setting and Datasets

在本章中,将介紹多個實驗中使用的資料集,以及實驗設定.

Online Learning on an Infinite Dataset Shapeset-3*2

該資料集可以随機生成包含3種形狀(triangle, parallelogram, ellipse)的無限多的圖檔,其中每張圖檔中随機包含2種圖形.

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

Finite Datasets

  • MNIST digits

MNIST資料集中包含50000張訓練圖檔,10000張測試圖檔,其中每張圖檔為28*28像素的灰階圖.

  • CIFAR-10

CIFAR-10資料集中包含50000張訓練圖檔,10000張測試圖檔,其中每張圖檔為32*32像素的彩色圖像. 這個資料集中包含10個種類的物體( airplane, automobile, bird, cat, deer, dog, frog, horse, ship, or truck).

  • Small-ImageNet

Small-ImageNet資料集中包含90000張訓練圖檔,10000張測試圖檔,其中每張圖檔為37*37像素的灰階圖像. 這個資料集中包含10個種類的物體( eptiles, vehicles, birds, mammals, fish, furniture, instruments, tools, flowers and fruits).

Experimental Setting

  • 激活函數

本次實驗使用了3種激活函數: sigmoid函數, 雙曲正切函數以及softsign函數.

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

雙曲正切函數以及softsign函數的曲線圖如下所示. 直覺來看softsign函數更加平滑,非線性區域更廣.

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks
  • 網絡層數

對于Shapeset-3*2資料集來說,神經網絡最好的深度為5層,但對于sigmoid激活函數來說,最好的層數為4層.

  • 初始化

偏置的初始化為0,每層權重的初始化為:

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

注意,n為前一個隐藏層神經元的個數.

Effect of Activation Functions and Saturation During Training

Experiments with the Sigmoid

以Sigmoid為激活函數有4個隐藏層的神經網絡的結果如下圖所示. 縱坐标為激活函數值,橫坐标為訓練的周期數,實線為激活函數均值. 可以看到第四層(top 層)激活函數的值很快下降到0附近,則此時模型處于飽和狀态,所有隐藏層的權值幾乎沒有調整. 直至訓練到100個周期之後,top層才擺脫飽和狀态,此時,其他隐藏層的權值才進行快速學習優化.

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

需要注意的是,基于Sigmoid激活函數的神經網絡如果層數為5,則無法擺脫飽和狀态.

文章認為出現這種飽和狀态的原因,是使用了傳統的随機初始化. 緩解這種飽和狀态的方法是使用預訓練模型[1],具體方法為:首先使用無監督的方法得到BP網絡中的初始化權值,然後再對BP神經網絡進行微調,得到效果更好的模型.

Experiments with the Hyperbolic tangent

下圖中的上半部分使用的是雙曲正切函數,下半部分使用softsign函數.

基于雙曲正切激活函數模型的lay1很快進入飽和狀态,随着訓練的增加,其他隐藏層也逐漸進入飽和狀态.

基于softsign函數模型的隐藏層在經過多次訓練後,都沒有進入飽和狀态.

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

下圖的上半部分使用的是雙曲正切函數,下半部分使用softsign函數.

基于雙曲正切激活函數模型的激活函數值大多處于0, 1, -1的狀态下. 這表明,這些隐藏層多處于飽和狀或者隻能描繪線性的情況.

基于softsign函數模型的激活函數值,除了lay5的激活函數值處于0狀态下比較多,其他隐藏層的值都在[-0.8, -0.6] 或 [0.6, 0.8]的範圍内,這說明基于該激活函數的隐藏層沒有出現飽和狀态,且模型具有較好的學習性能.

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

Studying Gradients and their Propagation

本文提出了一種新的初始化方法,即标準初始化:

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

對比

  • 激活函數值

下圖中上半部分使用的是普通初始化,下半部分使用的是新的标準化方法. 可以看到,普通初始化方法得到的激活函數值多在0附近,而新的初始化方法所産生的激活函數值分布較廣,則對模型的學習訓練有較好的結果.

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks
  • 梯度
經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

Error Curves and Conclusions

經典DL論文研讀(part1)--Understanding the difficulty of training deep feedforward neural networks

繼續閱讀