Lab 1 Redes Neuronales

8
SOLUCION PREGUNTA 1 Solución: x=[-11 -16 51 10;12 1 -10 -11; 50 26 -25 -5; 10 -16 -15 1; 11 -18 -11 1; 5 51 -6 -5] w=[1.24 1.11 2.2 2; 1.74 2.35 4 4; 5.74 1.35 2 2; -1.81 2.96 1 -3] b=[2.11 -3.00 0 -2.2] B=[b;b;b;b;b;b]%Matriz de 6 filas de 4 columnas net=x*w+B y=hardlims(net) x = -11 -16 51 10 12 1 -10 -11 50 26 -25 -5 10 -16 -15 1 11 -18 -11 1 5 51 -6 -5 w = 1.2400 1.1100 2.2000 2.0000 1.7400 2.3500 4.0000 4.0000 5.7400 1.3500 2.0000 2.0000 -1.8100 2.9600 1.0000 -3.0000 b = 2.1100 -3.0000 0 -2.2000 B = 2.1100 -3.0000 0 -2.2000 2.1100 -3.0000 0 -2.2000 2.1100 -3.0000 0 -2.2000 2.1100 -3.0000 0 -2.2000 2.1100 -3.0000 0 -2.2000

description

redes neuronales

Transcript of Lab 1 Redes Neuronales

Page 1: Lab 1 Redes Neuronales

SOLUCION PREGUNTA 1

Solución:x=[-11 -16 51 10;12 1 -10 -11; 50 26 -25 -5; 10 -16 -15 1; 11 -18 -11 1; 5 51 -6 -5]w=[1.24 1.11 2.2 2; 1.74 2.35 4 4; 5.74 1.35 2 2; -1.81 2.96 1 -3]b=[2.11 -3.00 0 -2.2]B=[b;b;b;b;b;b]%Matriz de 6 filas de 4 columnasnet=x*w+B y=hardlims(net)

x =

-11 -16 51 10 12 1 -10 -11 50 26 -25 -5 10 -16 -15 1 11 -18 -11 1 5 51 -6 -5

w =

1.2400 1.1100 2.2000 2.0000 1.7400 2.3500 4.0000 4.0000 5.7400 1.3500 2.0000 2.0000 -1.8100 2.9600 1.0000 -3.0000

b =

2.1100 -3.0000 0 -2.2000

B =

2.1100 -3.0000 0 -2.2000 2.1100 -3.0000 0 -2.2000 2.1100 -3.0000 0 -2.2000 2.1100 -3.0000 0 -2.2000 2.1100 -3.0000 0 -2.2000 2.1100 -3.0000 0 -2.2000

Page 2: Lab 1 Redes Neuronales

net = 235.2700 45.6400 23.8000 -16.2000 -18.7600 -33.3900 -0.6000 38.8000 -25.1000 65.0500 159.0000 166.8000 -101.2400 -46.7900 -71.0000 -79.2000 -80.5200 -44.9800 -68.8000 -77.2000 71.6600 99.5000 198.0000 214.8000

y = 1 1 1 -1 -1 -1 -1 1 -1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1

ASI CAMBIEMOS EL BIAS=0 LA SALIDA NO CAMBIA, SIGUE SIENDO LA SALIDA QUE SE DESEA

2.11X1 1.24

1.74 Y1 5.74 -1.81X2 1.11

2.35 1.11 Y2

1.35X3 4 2.96

2.2 2 2.2 Y3

4X4 1 2

2 -3 2

Y4

1

2

3

41

Page 3: Lab 1 Redes Neuronales

SOLUCION PREGUNTA 2

Solución

x=[-11 -16 51 10;12 1 -10 -11;50 26 -25 -5;10 -16 -15 1;11 -18 -11 1; 5 51 -6 -5]w=[1.24 1.11 2.2 2;1.74 2.35 4 4; 5.74 1.35 2 2;-1.81 2.96 1 -3]b=[0 0 0 0]B=[b;b;b;b;b;b];NET=x*w+By=hardlims(NET)

x =

-11 -16 51 10 12 1 -10 -11 50 26 -25 -5 10 -16 -15 1 11 -18 -11 1 5 51 -6 -5

w =

1.2400 1.1100 2.2000 2.0000 1.7400 2.3500 4.0000 4.0000 5.7400 1.3500 2.0000 2.0000 -1.8100 2.9600 1.0000 -3.0000

b = 0 0 0 0

NET =

233.1600 48.6400 23.8000 -14.0000 -20.8700 -30.3900 -0.6000 41.0000 -27.2100 68.0500 159.0000 169.0000 -103.3500 -43.7900 -71.0000 -77.0000 -82.6300 -41.9800 -68.8000 -75.0000 69.5500 102.5000 198.0000 217.0000

Page 4: Lab 1 Redes Neuronales

y =

1 1 1 -1 -1 -1 -1 1 -1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1

0X1 1.24

1.74 Y1 5.74 -1.81X2 1.11

2.35 0 Y2

1.35X3 4 2.96

2.2 0 2 Y3

4X4 1 2

2 -3 0

Y4

1

2

3

41

Page 5: Lab 1 Redes Neuronales

SOLUCION PREGUNTA 3

x = [0.59 1.72; -2.67 2.50; 1.43 -3.19; 3.25 -2.88; -1.38 1.14; 2.3 3.3; 1.1 -2.1;2.5 3.5]w = [10.74 1.35 2.4 3.5 -6.7 2.3; -4.81 2.95 1.5 -3 2.2 1.0]b = [2.4 -3.5 -4.81 2.96 1.0 -2] B = [b;b;b;b;b;b;b;b]; Net=x*w + B;y=hardlims(Net);yd=y; x1=linspace(-4,4,10); x2=(x1*-10.74-2.4)/(-4.81);x21=(x1*-1.35+3.5)/(2.95);x22=(x1*-2.4+4.81)/(1.5);x23=(x1*-3.5-2.96)/(-3);x24=(x1*6.7-1.0)/(2.2);x25=(x1*-2.3+2)/(2.95); figure(1)hold on plot(x1,x2),% Grafico de la Primera Recta plot(x1,x21)% Grafico de la Segunda Recta plot(x1,x22),% Grafico de la Tercera Recta plot(x1,x23)% Grafico de la Cuarta Recta plot(x1,x24),% Grafico de la Quinta Recta plot(x1,x25)% Grafico de la Sexta Recta plot(x(1,1),x(1,2),'k+'),text(x(1,1)+.2,x(1,2)+.4,'Primer Patrón') plot(x(2,1),x(2,2),'k^'),text(x(2,1)+.2,x(2,2)+.4,'Segundo Patrón') plot(x(3,1),x(3,2),'rs'),text(x(3,1)+.2,x(3,2)+.4,'tercer Patrón') plot(x(4,1),x(4,2),'mo'),text(x(4,1)+.2,x(4,2)+.4,'Cuarto Patrón') plot(x(5,1),x(5,2),'mo'),text(x(5,1)+.2,x(5,2)+.4,'Quinto Patrón') plot(x(6,1),x(6,2),'rs'),text(x(6,1)+.2,x(6,2)+.4,'Sexto Patrón') plot(x(7,1),x(7,2),'mo'),text(x(7,1)+.2,x(7,2)+.4,'Septimo Patrón') plot(x(8,1),x(8,2),'rs'),text(x(8,1)+.2,x(8,2)+.4,'Octavo Patrón') grid onhold off

yd =

1 1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 1 -1 -1 -1 -1 1 -1 1 1 1 1 -1 1 1 -1 -1 1 -1 -1 1 1 1 1 -1 1

Page 6: Lab 1 Redes Neuronales

Para X1: Para X2:

w11 = 10.74 w21 = -4.81

w12 = 1.35 w22 = 2.96

w13 = 2.4 w23 = 1.5

w14 = 3.5 w24 = -3

w15 = -6.7 w25 = 2.2

w16 = 2.3 w26 = 1

Page 7: Lab 1 Redes Neuronales

INTEGRANTES

1. COICA CERRON MARCO ANTONIO2. GAMARRA FUERTES JOSE ANTONIO3. SACSA CHULLUNCUY CARLOS ALBERTO4. BEJAR VEGA UBALDO FABIO