zoukankan      html  css  js  c++  java
  • [转]感知器(Perceptron)原理和应用

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

      源地址: 小崔爱自由

    其实早就想总结这个在模式识别领域重要的理论了,今天终于有时间把*期*生对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.
  • 相关阅读:
    HTTP协议开发应用-文件服务器
    编解码-marshalling
    编解码-protobuf
    编解码-java序列化
    算法笔记_114:等额本金(Java)
    算法笔记_113:算法集训之代码填空题集一(Java)
    算法笔记_112:第五届蓝桥杯软件类省赛真题(Java本科B组)试题解答
    算法笔记_111:第五届蓝桥杯软件类省赛真题(Java本科A组)试题解答
    算法笔记_110:第四届蓝桥杯软件类省赛真题(JAVA软件开发高职高专组部分习题)试题解答
    算法笔记_109:第四届蓝桥杯软件类省赛真题(JAVA软件开发本科B组部分习题)试题解答
  • 原文地址:https://www.cnblogs.com/moondark/p/2724492.html
Copyright © 2011-2022 走看看