What is the method of adjusting matlab perceptron?
This article mainly explains "what is the method of matlab perceptron adjustment", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "what is the method of matlab perceptron adjustment"!
The perceptron is tuned by the mae function, which is a network performance function that measures system performance in terms of mean absolute error. Other performance functions include mse: mean square error sse: sum of squares of errors
%% clear,clcclose all%% adapt for perceptron % create perceptron net=newp ([-1,2;-2,2 $>,1);% define training vector P={[0;0] [0;1] [1;0] [1;1]};T={0,0,1,1};% adjust [net,y,ee,pf] = adapt(net,P,T);ma=mae(ee);ite=0;while ma>=0.15[net,y,ee,pf] = adapt (net,P,T,pf);ma=mae(ee);newT=sim(net,P);ite=ite+1;if ite>=10break; end %% clean clear,clcclose all%% adapt for linear networks % create linear networks net=newlin ([-1,1 $>,1,[0,1],0.5);% define training vector 1P1 ={-1,0,1,0,1,-1,0,1};T1={-1,-1,1,1,2,0,-1,-1,0,1,1};% adjust [net,y,ee,pf] = adapt (net,P1,T1);disp(mae(ee))% define training vector 2P2 ={1,-1,-1, 1,-1, 0, 0, 1,-1,-1};T2={2,0,-2, 0, 2, 0,-1, 0, 1, 0,-1};% adjust network [net,y,ee,pf] = adapt (net,P2,T2,pf);disp(mae(ee))% Train the network with all data P3=[P1,P2];T3=[T1,T2];net.adaptParam.passes=100;[net,y,ee,pf]=adapt (net,P3,T3,pf);disp(mae(ee))net=newp ([-10 10],1);% Create a perceptron with an input node and an output node p=[-10 -5 0 5 10];% Train input vector t=[0 0 1 1];% Expected output y=sim(net,p);% Direct simulation e=t-y;% Error perf=mae(e);% Mean absolute difference sum(abs(e))/length(e); % takes the absolute value and averages it, which is the same as the mae function net=train(net,p,t);
% After training, calculate the average absolute difference y=sim(net,p);e=t-y;perf=mae(e);% The average absolute difference is 0. I believe that everyone has a deeper understanding of "what is the method of adjusting matlab perceptron". Let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!