private void fillLayer(Neuron[] layer, int inputs, Neuron.NeuronTypes type, double[][] weights, double alfa)
 {
     for (int i = 0; i < layer.Length; i++)
     {
         layer[i] = new Neuron(type, alfa, -1);
         for (int j = 0; j < inputs; j++)
         {
             Synapse s = new Synapse(layer[i]);
             s.setWeight(weights[i][j]);
             layer[i].synapses.Add(s);
         }
         Synapse biasSynapse = new Synapse(layer[i]);
         biasSynapse.setWeight(weights[i][inputs]);
         layer[i].synapses.Add(biasSynapse);
     }
 }
 private void fillNonInputLayer(Neuron[] previousLayer, Neuron[] layer, int inputs, Neuron.NeuronTypes type, double alfa)
 {
     for (int i = 0; i < layer.Length; i++)
     {
         layer[i] = new Neuron(type, alfa, -1);
         for (int j = 0; j < inputs; j++)
         {
             Synapse s = new Synapse(previousLayer[j], layer[i]);
             s.setWeight(generateSynapseWeight(previousLayer, inputs));
             layer[i].synapses.Add(s);
         }
         Synapse biasSynapse = new Synapse(layer[i]);
         biasSynapse.setWeight(1);
         layer[i].synapses.Add(biasSynapse);
     }
 }