[轉]感知器(Perceptron)原理和應用


  這學期有模式識別課程, 講到線性分類器, 找到一篇很好的博客講關於感知器算法的, 現在wordpress似乎要翻牆了

  源地址: 小崔愛自由

其實早就想總結這個在模式識別領域重要的理論了,今天終於有時間把近期平生對Perceptron的一點理論基礎及其應用blog下來。其中不免有些理解錯誤的地方希望不要“誤人子弟”。也請大家幫忙改正。

要說起Perceptron,我們無疑要從線性分類器說起,它的特點就是簡單和可計算性。對於那些線性可分得訓練數據,我們當然能夠找到一個線性分類器將所有數據正確分類。而對於非線性可分的數據,可以通過優化規則,設計出最優的線性分類器。

線性分類器在數學上被理解為線性判別函數(Linear Discriminant Functions),在幾何上可以理解為決策超平面(Decision Hyperplanes)。感知器算法的誕生也就是為了確定線性判別函數中的未知參數向量w

我們用經典的優化問題方法來解決。這就需要定義(a)一個合適的代價函數(b)一個優化算法。Perceptron的代價函數可以認為時一個參數向量w,在對訓練樣本分類時的分類錯誤的總和。當然如果所有訓練樣本都被正確分類,則這個代價函數為0。這個代價函數是一個連續分段線性函數,如果平滑的改變參數向量w的值,代價函數也會線性的變化。為了計算出代價函數的最小迭代值,一般利用梯度下降法。

通過反復迭代的過程,對參數向量w的值進行修正,一直到它將所有的樣本分類正確,或者w收斂到某個值。(Perceptron算法的收斂性是可以證明的)

在實際的應用中一種更通用的算法–獎勵懲罰方案被廣泛使用。也就是說,塗過當前訓練樣本分類正確,不采取任何行動;否則如果樣本分類錯誤,參數向量w就根據該樣本成比例的修正自身權值。這個由Rosenblatt在1958年提出的算法,是用來訓練感知器的。該算法也被一直應用至今,可見其經典。

這是一個經典的感知器模型,包括n個輸入、n個權值,被稱作突觸權(synaptic weights),還有閾值(threshold)w0,在他們相加就和后,進入方塊所示的非線性部分–激活函數,通常使用硬限幅器(Hard Limiter)來實現,他們都是階躍函數,其輸出一般為兩個電平值0和1。我們稱帶有Hard Limiter的神經元為McCulloch-Pitts神經元。它是神經網絡的基礎,我們模型都是由這種MP神經元構成。

感知器的推廣:

  • 為了解決一些線性不可分的數據集,在[Gal 90]中提出了新的袋式算法(Pocket Algorithm)
  • 為了把perceptron推廣到解決多類分類問題,有人提出了Kesler結構。

對於優化算法,通常使用梯度下降(梯度下降法)的方法。有時為了加快收斂速度,也會使用一個近似的算法:隨機近似的梯度下降。

    • Perceptron Learning Rule
      In a Perceptron, we define the update-weights function in the learning algorithm above by the formula:

      wi = wi + delta_wi

      where

      delta_wi = alpha * (T – O) xi

      xi is the input associated with the ith input unit. alpha is a constant between 0 and 1 called the learning rate.

      Notes about this update formula:

      • Based on a basic idea due to Hebb that the strength of a connection between two units should be adjusted in proportion to the product of their simultaneous activations. A product is used as a means of measuring the correlation between the values output by the two units.
      • Also called the Delta Rule or the Widrow-Hoff Rule
      • "Local" learning rule in that only local information in the network is needed to update a weight
      • Performs gradient descent in "weight space" in that if there are n weights in the network, this rule will be used to iteratively adjust all of the weights so that at each iteration (training example) the error is decreasing (more correctly, the error is monotonically non-increasing)
      • Correct output (T = O) causes no change in a weight
      • xi = 0 causes no change in weight
      • Does not depend on wi
      • If T=1 and O=0, then increase the weight so that hopefully next time the result will exceed the threshold at the output unit and cause the output O to be 1
      • If T=0 and O=1, then decrease the weight so that hopefully next time the result will be below the threshold and cause the output to be 0.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM