lunes, 26 de abril de 2010
Act 220310_2-SIMULACION DE UNA RED NEURONAL
FIG.1
FIG.2
FIG.3
GENERACION DE LAS ITERACIONES.
CODIGO FUENTE.
mport javax.swing.*;
public class neuron{
public static void main (String args[])
{
double p[]={2,0,-2,0};
double pp[] ={1,-1,1,2};
double b,c,a,w11,w12,p1,p2,t,e;
for (int i=0;i<=3;i++){ w11= 3.3; w12= -1.8; b=0.5; p1= (p[i]* w11); p2=(pp[i] *w12); c=(p1+p2+b); if(c>0){
a=1;
t=1;
e=b-b;
JOptionPane.showMessageDialog(null," Jhon Charly,kirycorp y Megan"+"\n"+" iteracion numero "+i+"\n"+" n= "+c+"\n"+
" a= "+a+"\n"+" t= "+t+"\n"+" e= "+e+"\n"+" w11= "+w11+"\n"+" w12= "+w12) ;
System.out.println("iteracion #="+i);
System.out.println("n="+c);
System.out.println("a="+a);
System.out.println("t="+t);
System.out.println("e="+e);
System.out.println("w11="+w11);
System.out.println("w12="+w12);
}else if(c<0){
a=-1;
t=-1;
e=b-b;
JOptionPane.showMessageDialog(null," Jhon Charly,kirycorp y Megan"+"\n"+" iteracion numero "+i+"\n"+" n= "+c+"\n"+
" a= "+a+"\n"+" t= "+t+"\n"+" e= "+e+"\n"+" w11= "+w11+"\n"+" w12= "+w12) ;
System.out.println("iteracion #="+i);
System.out.println("n="+c);
System.out.println("a="+a);
System.out.println("t="+t);
System.out.println("e="+e);
System.out.println("w11="+w11);
System.out.println("w12="+w12);
}
}
}
}
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario