Neural network 感知器中的超平面

Neural network 感知器中的超平面,neural-network,perceptron,Neural Network,Perceptron,在讨论神经网络和感知器时,什么是超平面 下面的感知器是使用超平面实现的 感知器_minin.m(倍频程) 现在,我有几个问题 (1) 第一个源代码正确吗 (2) 如果是,请解释它们都起作用的原因。权重不是超平面的同义词,但它们是相关的:超平面是由权重值定义的。什么是超平面?@ScottHunter,seplane实际上是超平面。在第一个源代码中,该逻辑在哪里使用? function [errors, sepplane ] = perceptron_minin ( pclass , nclass)

在讨论神经网络和感知器时,什么是超平面

下面的感知器是使用超平面实现的

感知器_minin.m
(倍频程)

现在,我有几个问题

(1) 第一个源代码正确吗


(2) 如果,请解释它们都起作用的原因。

权重不是超平面的同义词,但它们是相关的:超平面是由权重值定义的。

什么是超平面?@ScottHunter,
seplane
实际上是超平面。在第一个源代码中,该逻辑在哪里使用?
function [errors, sepplane ] = perceptron_minin ( pclass , nclass)
    sepplane = rand ( 1 , columns ( pclass ) + 1 ) - 0.5;
    tset = [ones(rows(pclass), 1),  pclass ; -ones(rows(nclass), 1), -nclass];
    i = 1;
    do
        misind = tset * sepplane' < 0;

        correction = sum ( tset ( misind , :), 1 ) / sqrt ( i );

        sepplane = sepplane + correction;

        ++i;
    until ( norm(sepplane) * 0.0005 ) - norm(correction) > 0 || i > 1000);

    errors = mean( tset * sepplane' < 0);
    dzeros = tvec(tlab == 1 , :);
    dones = tvec(tlab == 2 , :);
    perceptron(dzeros, dones)
end
bias = -1;
coeff = 0.7;
rand('state', sum(100 * clock));
weights = -1*2 .* rand(3,1);

train_iter = 10000;
train_data_count = 4;
test_data_count  =  100;

%%  training section

train_data = [   0  0; 
                 0  1; 
                 1  0; 
                 1  1];

class_labels = [0;
               1;
               1;
               1];

bias_vector(1:train_data_count, 1) = bias;

train_data_biased = [bias_vector, train_data];

for i=1:train_iter
    output = zeros(train_data_count,1);
    for j=1:train_data_count   
        y = product(train_data_biased(j,:), weights);

        output(j)  = activ_func(y);

        delta = class_labels(j) - output(j);

        inc = train_data_biased(j,:) * (coeff  * delta);

        weights = weights + inc';
    end
end

table(train_data(:,1), train_data(:,2), output, 'VariableNames', {'A' 'B' 'A_xor_B'})


%% test Section

test_data = randi([0 , 1], [test_data_count, 2]) + 
            (2 * rand(test_data_count,2) - 1) / 20;

for i=1:test_data_count
   y = bias*weights(1,1)+...
       test_data(i,1)*weights(2,1)+...
       test_data(i,2)*weights(3,1);
   output(i) = 1/(1+exp(-y));
end

table(test_data(:,1),test_data(:,2), output,
       'VariableNames',{'A' 'B' 'A_xor_B'})