Spencer's Final Report
multilayer perceptron(MLP)
multilayer perceptron (MLP) can make reflection artificial neural network model that sets of input data on a set of appropriate outputs. An MLP consists of multiple layers of nodes on a directed graph,
neural network:
Using input data to obtain plasma parameters A computer code or circuit, this encoding in advance by a series of examples of "thinking process of the human brain" training.
Reviews: In fact my english is not enough so I spend very much time to fix it.see many time and practice like teacher say Sure enough, every one will look to understand a little more, i will continuous to Learn this subject, thank you teacher this term care.
MATLAB CODE:
%
x = linspace(-2, 2, 60);
y = linspace(-2, 2, 60);
[xx, yy] = meshgrid(x, y);
for n = 0 : 15
s = dec2bin(n,4); s = s';
d = hardlims(str2num(s)-0.5); % desire
d = d';
% ------------------------------------------
for c = -1:2:1
nn1 = c*sign(xx./(xx.^2+yy.^2) + yy./(xx.^2+yy.^2) - 1);
nn2 = c*sign(xx./(xx.^2+yy.^2) - yy./(xx.^2+yy.^2) - 1);
nn3 = c*sign(-xx./(xx.^2+yy.^2) + yy./(xx.^2+yy.^2) - 1);
nn4 = c*sign(-xx./(xx.^2+yy.^2) - yy./(xx.^2+yy.^2) - 1);
ee0 = 0.5*((d(1)*ones(size(nn1))-nn1).^2+(d(2)*ones(size(nn1))-nn2).^2+(d(3)*ones(size(nn1))-nn3).^2+(d(4)*ones(size(nn1))-nn4).^2);
if c == -1; subplot(1,3,1); else subplot(1,3,2); end
surf(xx, yy, ee0,'FaceAlpha',0.5);
hidden off
colormap(jet)
title(strcat('d = ',num2str(d),', c = ',num2str(c)))
xlabel('x1'); ylabel('x2'); zlabel('error');
axis equal
if c == -1
een = 0.5*((d(1)*ones(size(nn1))-nn1).^2+(d(2)*ones(size(nn1))-nn2).^2+(d(3)*ones(size(nn1))-nn3).^2+(d(4)*ones(size(nn1))-nn4).^2);
else
eep = 0.5*((d(1)*ones(size(nn1))-nn1).^2+(d(2)*ones(size(nn1))-nn2).^2+(d(3)*ones(size(nn1))-nn3).^2+(d(4)*ones(size(nn1))-nn4).^2);
end
end % c
%------ plot solution space ------------------
subplot(1,3,3);
a = find(eep == 0 | een == 0);
a1 = xx(a);
a2 = yy(a);
px = [1, 1, -1, -1]; py = [1, -1, 1, -1];
pox = px(find(d==1)); poy = py(find(d==1));
pxx = px(find(d==-1)); pxy = py(find(d==-1));
plot(a1, a2, 'y.', pox, poy, 'ko', pxx, pxy, 'kx');
%plot(a1, a2, 'y.', pxx, pxy, 'kx');
axis([-2, 2, -2, 2]);
axis square;
set(gca, 'xtick', [0])
set(gca, 'ytick', [0])
%------ plot solution space ------------------
pause
clf
end % n