Пример #1
0
        public void FeedForward(double[] input)
        {
            foreach (Neuron n in Neurons)
            {
                n.Net = input[Neurons.IndexOf(n)];
            }

            if (LayerAfter != null)
            {
                double[] newInput = new double[LayerAfter.Neurons.Count];

                foreach (Neuron n in LayerAfter.Neurons)
                {
                    double netSum = 0;
                    foreach (Connection c in n.Connections)
                    {
                        double neuronValue = c.FromNeuron.Out;
                        netSum += c.Weight * neuronValue;
                    }
                    newInput[LayerAfter.Neurons.IndexOf(n)] = netSum;
                }

                LayerAfter.FeedForward(newInput);
            }
        }
Пример #2
0
 public int GetWinnerIndex(Vector <double> input)
 {
     return(Neurons.IndexOf(GetWinner(input)));
 }