예제 #1
0
 public RBFNeuroSystem(int first, int second)
 {
     Neurons    = new object[2][];
     Neurons[0] = new RBFNeuron[first];
     Neurons[1] = new Neuro[second];
     for (int i = 0; i < first; i++)
     {
         Neurons[0][i] = new RBFNeuron();
     }
     for (int i = 0; i < second; i++)
     {
         Neurons[1][i] = new Neuro(first);
     }
 }
예제 #2
0
        public NeuroSystem(int[] levels, int input)
        {
            //this.levels = new int[] { 5, 2, 1 };
            this.levels = levels;
            neurons     = new Neuro[levels.Length][];
            for (int i = 0; i < levels.Length; i++)
            {
                neurons[i] = new Neuro[levels[i]];
                for (int j = 0; j < levels[i]; j++)
                {
                    neurons[i][j] = new Neuro();
                }
            }
            for (int i = levels.Length - 1; i >= 1; i--)
            {
                for (int j = 0; j < levels[i]; j++)
                {
                    neurons[i][j].n = levels[i - 1];
                    neurons[i][j].X = new double[levels[i - 1]];
                    neurons[i][j].W = new double[levels[i - 1]];
                    //neurons[i][j].Alpha = 1.0;
                    for (int k = 0; k < neurons[i][j].W.Length; k++)
                    {
                        neurons[i][j].W[k] = random.NextDouble();
                    }
                }
            }


            for (int j = 0; j < levels[0]; j++)
            {
                neurons[0][j].n = input;
                neurons[0][j].X = new double[input];
                neurons[0][j].W = new double[input];
                //neurons[0][j].Alpha = 1.0;
                for (int k = 0; k < neurons[0][j].W.Length; k++)
                {
                    neurons[0][j].W[k] = random.NextDouble();
                }
            }
        }