示例#1
0
 private void CreateNetwork(NeuralLayer connectingFrom, NeuralLayer connectingTo)
 {
     foreach (var to in connectingTo.Neurons)
     {
         foreach (var from in connectingFrom.Neurons)
         {
             to.Dendrites.Add(new Dendrite()
             {
                 InputPulse = to.outputPulse, SynapticWeight = connectingTo.Weight
             });
         }
     }
 }
示例#2
0
        public void AddLayer(NeuralLayer layer)
        {
            int dendriteCount = 1;

            if (Layers.Count > 0)
            {
                dendriteCount = Layers.Last().Neurons.Count;
            }

            foreach (var element in layer.Neurons)
            {
                for (int i = 0; i < dendriteCount; i++)
                {
                    element.Dendrites.Add(new Dendrite());
                }
            }
        }