Esempio n. 1
0
 private void CreateLayers(int[] shape)
 {
     foreach (int layerSize in shape)
     {
         if (Layers.Count > 0)
         {
             NeuronLayer lastLayer = Layers.Last();
             NeuronLayer newLayer  = new NeuronLayer(layerSize, _rnd);
             lastLayer.RigtLayer = newLayer;
             newLayer.LeftLayer  = lastLayer;
             Layers.Add(newLayer);
         }
         else
         {
             Layers.Add(new NeuronLayer(layerSize, _rnd));
         }
     }
 }
Esempio n. 2
0
 public void SetInputLayer(double[] inputArray)
 {
     //comment for simple input
     //inputArray = AddSinSquareInput(inputArray);
     if (InputLayer == null)
     {
         InputLayer = new NeuronLayer(inputArray.Length, _rnd)
         {
             RigtLayer = Layers.First()
         };
         Layers.First().LeftLayer = InputLayer;
         ConnectInputLayer();
     }
     for (int i = 0; i < inputArray.Length; i++)
     {
         InputLayer.Neurons[i].Output = inputArray[i];
     }
 }