Esempio n. 1
0
 /**
  * Create a copy of the layer given in parameter,
  * if mutate is true, apply mutations to the copy
  */
 public Layer(Layer layer, bool mutate = true)
 {
     neurones = new Neurone[layer.Neurones.Length];
     for (int i = 0; i < layer.Neurones.Length; ++i)
     {
         neurones[i] = new Neurone(layer.Neurones[i], mutate);
     }
 }
Esempio n. 2
0
        /**
         * Create a new random layer of the given size
         * Neurones of the layer have 'prev_size' weights,
         * which is the size of the previous layer
         */
        public Layer(int size, int prev_size)
        {
            neurones = new Neurone[size];

            for (int i = 0; i < size; ++i)
            {
                neurones[i] = new Neurone(prev_size);
            }
        }
Esempio n. 3
0
        /**
         * Create a copy of the neurone given in parameter
         * if mutate is true, apply mutations the copy
         */
        public Neurone(Neurone neurone, bool mutate = true)
        {
            value   = 0;
            weights = new double[neurone.weights.Length];
            biais   = neurone.biais;
            for (int i = 0; i < weights.Length; ++i)
            {
                weights[i] = neurone.weights[i];
            }

            if (mutate)
            {
                Mutate();
            }
        }
Esempio n. 4
0
 /**
  * Merge the neurone with the one given in parameter in place
  * FIXME
  */
 public void Mix(Neurone partner)
 {
     throw new NotImplementedException();
 }
Esempio n. 5
0
 /**
  * Merge the neurone with the one given in parameter in place
  * FIXME
  */
 public void Mix(Neurone partner)
 {
 }