Example #1
0
 public Web(double[][,] weights)
 {
     _web    = new NeuronLayer[weights.Length];
     _web[0] = new NeuronLayer(null, weights[0]);
     for (int i = 1; i < weights.Length; i++)
     {
         _web[i] = new NeuronLayer(_web[i - 1], weights[i]);
     }
 }
Example #2
0
 public Web(int[] size)
 {
     _web    = new NeuronLayer[size.Length];
     _web[0] = new NeuronLayer(null, size[0], a);
     for (int i = 1; i < size.Length; i++)
     {
         _web[i] = new NeuronLayer(_web[i - 1], size[i]);
     }
 }
Example #3
0
 public void SetWeight(double[][,] value)
 {
     _web    = new NeuronLayer[value.Length];
     _web[0] = new NeuronLayer(null, 1, a);
     for (int i = 1; i < value.Length; i++)
     {
         _web[i] = new NeuronLayer(_web[i - 1], value[i].GetLength(0), a);
         _web[i].SetWeights(value[i]);
     }
 }
Example #4
0
        public bool Equalse(NeuronLayer other)
        {
            bool b = true;

            if (_layer.Length != other.Length)
            {
                return(false);
            }
            for (int i = 0; i < _layer.Length; i++)
            {
                b &= _layer[i].Equals(other._layer[i]);
            }
            return(b);
        }
Example #5
0
 public NeuronLayer(NeuronLayer PLayer, int size)
 {
     _previousLayer = PLayer;
     _layer         = new Neuron[size];
     for (int i = 0; i < size; i++)
     {
         if (PLayer != null)
         {
             _layer[i] = new Neuron(PLayer.Length);
         }
         else
         {
             _layer[i] = new Neuron(1);
         }
     }
 }
Example #6
0
 public NeuronLayer(NeuronLayer PLayer, double[,] weights)
 {
     _previousLayer = PLayer;
     if (weights != null)
     {
         _layer = new Neuron[weights.GetLength(0)];
         for (int i = 0; i < _layer.Length; i++)
         {
             _layer[i] = new Neuron(weights.GetLength(1));
             double[] tmp = new double[weights.GetLength(1)];
             for (int j = 0; j < tmp.Length; j++)
             {
                 tmp[j] = weights[i, j];
             }
             _layer[i].SetWeight(tmp);
         }
     }
 }