为什么weka中的多层感知器有阈值

why is there threshold in multilayer perceptron in weka

您好,我已经在 weka 工具中训练了虹膜数据集的多层感知器。结果它给了我以下模型。

    === Run information ===

    Scheme:weka.classifiers.functions.MultilayerPerceptron -L 0.3 -M 0.2 -N 500 -V 0 -S 0 -E 20 -H a -G -R
    Relation:     iris
    Instances:    150
    Attributes:   5
                  sepallength
                  sepalwidth
                  petallength
                  petalwidth
                  class
    Test mode:split 66.0% train, remainder test

    === Classifier model (full training set) ===

    Sigmoid Node 0
        Inputs    Weights
        Threshold    -3.5015971588434014
        Node 3    -1.0058110853859945
        Node 4    9.07503844669134
        Node 5    -4.107780453339234
    Sigmoid Node 1
        Inputs    Weights
        Threshold    1.0692845992273177
        Node 3    3.8988736877894024
        Node 4    -9.768910360340264
        Node 5    -8.599134493151348
    Sigmoid Node 2
        Inputs    Weights
        Threshold    -1.007176238343649
        Node 3    -4.2184061338270356
        Node 4    -3.626059686321118
        Node 5    8.805122981737854
    Sigmoid Node 3
        Inputs    Weights
        Threshold    3.382485556685675
        Attrib sepallength    0.9099827458022276
        Attrib sepalwidth    1.5675138827531276
        Attrib petallength    -5.037338107319895
        Attrib petalwidth    -4.915469682506087
    Sigmoid Node 4
        Inputs    Weights
        Threshold    -3.330573592291832
        Attrib sepallength    -1.1116750023770083
        Attrib sepalwidth    3.125009686667653
        Attrib petallength    -4.133137022912305
        Attrib petalwidth    -4.079589727871456
    Sigmoid Node 5
        Inputs    Weights
        Threshold    -7.496091023618089
        Attrib sepallength    -1.2158878822058787
        Attrib sepalwidth    -3.5332821317534897
        Attrib petallength    8.401834252274096
        Attrib petalwidth    9.460215580472827
    Class Iris-setosa
        Input
        Node 0
    Class Iris-versicolor
        Input
        Node 1
    Class Iris-virginica
        Input
        Node 2


    Time taken to build model: 34.13 seconds

我是 weka 的新手,我不明白这里的节点是如何编号的?为什么我们在使用 sigmoid 时需要阈值。输出中可以有多个属性吗?

有3个输出节点(0、1、2)和3个隐藏单元(3、4、5)。您可以通过查看它们连接到什么来区分,例如

    Sigmoid Node 3
    Inputs    Weights
    Threshold    3.382485556685675
    Attrib sepallength    0.9099827458022276
    Attrib sepalwidth    1.5675138827531276
    Attrib petallength    -5.037338107319895
    Attrib petalwidth    -4.915469682506087

显然是一个隐藏节点,因为它连接到 输入属性 。因此连接到这个节点的节点在下一层 (0, 1, 2)。

通常 WEKA 会从输出层到输入层对节点进行编号,因此您首先得到 outptu 节点,然后是连接到它们的节点,然后是上一层,上一层……最后是第一个隐藏层。

为什么会有门槛?因为 sigmoid 定义为

sigmoid(w,x,b) = 1/(1+exp(-(<w,x>-b)))

b是阈值。没有它,无论权重是多少,每个节点都会对 x=0 给出完全相同的输出。