import java.util.*; import java.io.*; import java.lang.Math; class neural_net_blah_2 { public static void main(String args[]) { //mod 3? //numbers 1-8..maybe. test 5. net nn = new net(3,2,3); for(int k=0;k<10;k++) { int testnum=(int)(Math.random()*8); while(testnum==6) { testnum=(int)(Math.random()*8); } double in_test[]=new double[3]; in_test[0]=(int)(testnum/8); testnum-=in_test[0]; in_test[1]=(int)(testnum/4); testnum-=in_test[1]; in_test[2]=testnum; System.out.println(testnum+" " + in_test[0]+":"+in_test[1]+":"+in_test[2]); } double in_test[]={1.0,1.0,0.0}; nn.test(ex_in); // nn.display(); } } class neuron { public static int NEXT_ID=1; public int ID; public double weights[]; public neuron[] neighbors; //things that fire to it public int num_neighbors=0; public int max_neighbors; public double sum=0; public double output=0; public double delta=0; public double dws=0; public neuron(int m) { ID=NEXT_ID++; max_neighbors=m; weights=new double[max_neighbors]; neighbors=new neuron[max_neighbors]; } public void clear() { sum=0; output=0; delta=0; dws=0; } public void setWeights(double[] w) { weights=w; } public void randomize_weights() { for(int i=0;i