deep learning---SAE(stacked autoencoder)

SAE棧式自編碼器參考自網頁http://ufldl.stanford.edu/wiki/index.php/Stacked_Autoencoders點擊打開鏈接

A stacked autoencoder is a neural network consisting of multiple layers of sparse autoencoders in which the outputs of each layer is wired to the inputs of the successive layer. 就是把前一層自編碼器的中間的隱藏層(特徵1)作爲後一層自編碼器的輸入,再將得到的隱含層(特徵2 )作爲下一層的輸入,如此重複,最後將得到的特徵作爲輸入集輸入到softmax classifier(或者其他分類器)中訓練。然後整個網絡訓練完之後,將各個步驟得到的特徵矩陣與分類器的參數合成新的網絡。 (大概意思,僅供參考)

可以看下面這個例子增強理解

具體的例子

訓練2個隱含層的MNIST 數字分類

First, you would train asparse autoencoderon the raw inputs x(k) to learn primary features h(1)(k) on the raw input.

Next, you would feed the raw input into this trained sparse autoencoder, obtaining the primary feature activations h(1)(k) for each of the inputs x(k). You would then use these primary features as the "raw input" to another sparse autoencoder to learn secondary features h(2)(k) on these primary features

Following this, you would feed the primary features into the second sparse autoencoder to obtain the secondary feature activations h(2)(k) for each of the primary features h(1)(k) (which correspond to the primary features of the corresponding inputs x(k)). You would then treat these secondary features as "raw input" to a softmax classifier, training it to map secondary features to digit labels.


Finally, you would combine all three layers together to form a stacked autoencoder with 2 hidden layers and a final softmax classifier layer capable of classifying the MNIST digits as desired。

組成新的網絡

大致實驗步驟:

  1. 初始化參數;
  2. 在原數據上訓練第一個自編碼器,然後算出L1 features;
  3. 在L1 features上訓練第二個自編碼器,然後算出L2 features;
  4. 在L2 features上訓練softmax分類器;
  5. stacked autocoders+softmax模型,用BP算法微調參數;
  6. 測試模型

 棧式自編碼具有很強大的表達能力及深度網絡的所有優點, 自編碼器傾向於學習到數據的特徵表示 對於棧式自編碼器,第一層可以學習到一階特徵,第二層可以學到二階特徵等等,對於圖像而言,第一層可能學習到邊,第二層可能學習到如何去組合邊形成輪廓、點,更高層可能學習到更形象且更有意義的特徵,學到的特徵方便我們更好地處理圖像,比如對圖像分類、檢索等等。

發佈了28 篇原創文章 · 獲贊 18 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章