[转]感知器(Perceptron)原理和应用

  这学期有模式识别课程, 讲到线性分类器, 找到一篇很好的博客讲关于感知器算法的, 如今wordpress彷佛要FQ了html

  源地址: 小崔爱自由算法

其实早就想总结这个在模式识别领域重要的理论了,今天终于有时间把近期生平对Perceptron的一点理论基础及其应用blog下来。其中难免有些理解错误的地方但愿不要“误人子弟”。也请你们帮忙改正。网络

要提及Perceptron,咱们无疑要从线性分类器提及,它的特色就是简单和可计算性。对于那些线性可分得训练数据,咱们固然可以找到一个线性分类器将全部数据正确分类。而对于非线性可分的数据,能够经过优化规则,设计出最优的线性分类器。ide

线性分类器在数学上被理解为线性判别函数(Linear Discriminant Functions),在几何上能够理解为决策超平面(Decision Hyperplanes)。感知器算法的诞生也就是为了肯定线性判别函数中的未知参数向量wwordpress

咱们用经典的优化问题方法来解决。这就须要定义(a)一个合适的代价函数(b)一个优化算法。Perceptron的代价函数能够认为时一个参数向量w,在对训练样本分类时的分类错误的总和。固然若是全部训练样本都被正确分类,则这个代价函数为0。这个代价函数是一个连续分段线性函数,若是平滑的改变参数向量w的值,代价函数也会线性的变化。为了计算出代价函数的最小迭代值,通常利用梯度降低法。函数

经过反复迭代的过程,对参数向量w的值进行修正,一直到它将全部的样本分类正确,或者w收敛到某个值。(Perceptron算法的收敛性是能够证实的)post

在实际的应用中一种更通用的算法–奖励惩罚方案被普遍使用。也就是说,涂过当前训练样本分类正确,不采起任何行动;不然若是样本分类错误,参数向量w就根据该样本成比例的修正自身权值。这个由Rosenblatt在1958年提出的算法,是用来训练感知器的。该算法也被一直应用至今,可见其经典。优化

这是一个经典的感知器模型,包括n个输入、n个权值,被称做突触权(synaptic weights),还有阈值(threshold)w0,在他们相加就和后,进入方块所示的非线性部分–激活函数,一般使用硬限幅器(Hard Limiter)来实现,他们都是阶跃函数,其输出通常为两个电平值0和1。咱们称带有Hard Limiter的神经元为McCulloch-Pitts神经元。它是神经网络的基础,咱们模型都是由这种MP神经元构成。ui

感知器的推广:this

  • 为了解决一些线性不可分的数据集,在[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.