예제 #1
0
 public void AddLayer(int length, Random rnd, double minWeight, double maxWeight, double minBias, double maxBias)
 {
     net.Add(new Neiron[length]);
     for (int i = 0; i < length; i++)
     {
         Neiron neiron;
         if (net.Count == 1)
         {
             neiron = new Neiron(new LinearActivationFunction(1, 0));
         }
         else
         {
             double[] d = new double[net[net.Count - 2].Length];
             d = d.Select(_ => Neiron.GenerateRandom(rnd, minWeight, maxWeight)).ToArray();
             Neiron[] n = net[net.Count - 2];
             neiron = new BasicNeiron(new SigmoidActivationFunction(4), ref n, d, Neiron.GenerateRandom(rnd, minBias, maxBias));
         }
         net.Last()[i] = neiron;
         neirons.Add(neiron);
     }
 }
예제 #2
0
 public void AddNeiron(Neiron neiron)
 {
     neirons.Add(neiron);
 }
예제 #3
0
 public Link(Neiron fromNeiron, Neiron toNeiron, double weight)
 {
     this.fromNeiron = fromNeiron;
     this.toNeiron   = toNeiron;
     this.weight     = weight;
 }