コード例 #1
0
        internal void AddAxon(int angle, Neuron n)
        {
            Axon axon = new Axon(angle, this, n);

            Axons.Add(axon);
            n.Axons.Add(axon);
        }
コード例 #2
0
        public double Gradient(double?target = null)
        {
            if (target == null)
            {
                return(gradient = Axons.Sum(a => a.targetNeuron.gradient * a.Weight) * Activate.sigmoidDerivative(value));
            }

            return(gradient = (target.Value - value) * Activate.sigmoidDerivative(value));
        }
コード例 #3
0
ファイル: Neuron.cs プロジェクト: damon-dev/SAIa
        public void RemoveAxon(Neuron destination)
        {
            if (destination == null || IsRoot() || destination.IsRoot())
            {
                return;
            }

            destination.DendriteStrength.Remove(this);
            destination.Dendrites.Remove(this);
            Axons.Remove(destination);
        }
コード例 #4
0
ファイル: Neuron.cs プロジェクト: damon-dev/SAIa
        public void CreateAxon(Neuron destination, double strength)
        {
            if (destination == null || IsRoot() || destination.IsRoot())
            {
                return;
            }

            if (destination.DendriteStrength.ContainsKey(this))
            {
                destination.DendriteStrength[this] = strength;
            }
            else
            {
                destination.DendriteStrength.Add(this, strength);
                destination.Dendrites.Add(this);
                Axons.Add(destination);
            }
        }