コード例 #1
0
        public void AddLayer(NeuralLayer layer)
        {
            var dendriteCount = 1;

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

            foreach (var neuron in layer.Neurons)
            {
                for (var i = 0; i < dendriteCount; i++)
                {
                    neuron.Dendrites.Add(new Dendrite());
                }
            }
        }
コード例 #2
0
        public void CreateNetwork(NeuralLayer connectingFrom, NeuralLayer connectingTo)
        {
            foreach (var from in connectingTo.Neurons)
            {
                from.Dendrites.Add(new Dendrite());
            }

            foreach (var to in connectingTo.Neurons)
            {
                foreach (var from in connectingFrom.Neurons)
                {
                    to.Dendrites.Add(new Dendrite()
                    {
                        InputPulse = from.OutputPulse, SynapticWeight = connectingTo.Weight
                    });
                }
            }
        }