internal void AddAxon(int angle, Neuron n) { Axon axon = new Axon(angle, this, n); Axons.Add(axon); n.Axons.Add(axon); }
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)); }
public void RemoveAxon(Neuron destination) { if (destination == null || IsRoot() || destination.IsRoot()) { return; } destination.DendriteStrength.Remove(this); destination.Dendrites.Remove(this); Axons.Remove(destination); }
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); } }