Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Inteligencia Artificial
clase 6b
Arturo Vilca
avilca@uni.edu.pe
posgrado uni-fiee 2017-2
Toolbox - Redes Neuronales
• Modelamiento
• Programación
• Toolbox de Redes Neuronales
• El Perceptrón
Modelo de Redes Neuronales
Xi yj
(i=1 a n) (j=1 a m)
Configuración
• Cálculo de activación de cada neurona
aj = ∑ xi wij
ECM=1; % inicialización
Red1…
for i=1:Nep
% fin del aprendizaje si ECM=0
if ECM == 0
i=i-1;
break
end
% fase de prueba
% activación
WX = W*X;
% ajuste de bias
WXmasb = WX + b*ones(size(WX));
Red1…
% cálculo de la salida y del error
salida = WXmasb >= 0;
error = T-salida;
[nx,mx]=size(X);
figure(1)
hold on
axis([x1min x1max x2min x2max])
Red1:recta.m…
for k=1:mx
Tcero=T(k)==0;
if Tcero
plot(X(1,k),X(2,k),'o')
else
plot(X(1,k),X(2,k),'+')
end
title([‘Vectores a clasificar y la recta de separación - época: '
num2str(i)])
xlabel('x1')
ylabel('x2')
grid
end
Red1:recta.m…
xx=get(gca,'xlim');
y=(-xx*W(1)-b)/W(2);
plot(xx,y,'r')
hold off
NN-ToolBox: Perceptrón
Funciones
• nnstart Neural network getting started GUI
• nftool Neural network fitting tool
• view View neural network
• fitnet Function fitting neural network
• feedforwardnet Feedforward neural network
• Cascadeforwardnet Cascade-forward neural network
• train Train neural network
• trainlm Levenberg-Marquardt backpropagation
• trainbr Bayesian regulation backpropagation
• trainscg Scaled conjugate gradient backpropagation
• trainrp Resilient backpropagation
• mse Mean squared normalized error performance function
• regression Linear regression
• ploterrhist Plot error histogram
• plotfit Plot function fit
• plotperform Plot network performance
• plotregression Plot linear regression
• plottrainstate Plot training state values
Función newp
• net = newp(p,t,tf,lf)
x = [0 0 1 1; 0 1 0 1];
t = [0 1 1 1];
red = perceptron;
red = train(red,x,t);
view(red)
y = red(x);
Red de perceptrones
feedforwardnet
x = [0 1 2 3 4 5 6 7 8];
t = [0 0.84 0.91 0.14 -0.77 -0.96 -0.28 0.66 0.99];
plot(x,t,'o')
red = feedforwardnet(10);
red = configure(red,x,t);
y1 = red(x)
plot(x,t,'o',x,y1,'x')
red = train(red,x,t);
y2 = red(x)
plot(x,t,'o',x,y1,'x',x,y2,'*')
nnstart