原文:一个简单的matlab程序告诉你学习速率对于BP神经网络收敛的影响
function test_easy_script
x = [0,0,1;0,1,1;1,0,1;1,1,1];
y = [0,1,1,0]';
for power = 1:5
alpha = 10^(-3+power)
%Output of function rand() in area (0,1) with mean = 0.5 distribution
%Do the operation to make sure the mean = 0
syn0 = 2*rand(3,4)-1;
syn1 = 2*rand(4,1)-1;
%Training the network
for i = 1:60000
l0 = x;
l1 = sigmoid(x*syn0);
l2 = sigmoid(l1*syn1);