public void PlugIn(List <Input> neurons) { foreach (var n in neurons) { var temp = n; foreach (var d in Dendrites.Where(d => d.Neuron.Name == temp.Name)) { d.Neuron = n; } } }
public void ForceCreateDendrite(Neuron source, double strength) { if (DendriteStrength.ContainsKey(source)) { DendriteStrength[source] = strength; } else { DendriteStrength.Add(source, strength); Dendrites.Add(source); source.Axons.Add(this); } }
public override double GetOutput(NeuralPathway path = null) { if (path != null) { if (path.Path.Count(Equivelant) > 2) { return(0); } path.Path.Add(this); } var sum = Dendrites.Aggregate <Dendrite, double>(0, (current, d) => current + (d.GetSignal(path))); return(Function(sum)); }
public void CountError(Layer layer) { List <double> all_multiplications = new List <double>(); foreach (var neuron in layer.Neurons) { if (neuron.Bias) { continue; } double weight = Dendrites .SingleOrDefault(x => x.TargetNeuron == neuron.ID) .Weight; all_multiplications.Add(weight * neuron.ErrorSignal); } double result = Value * (1 - Value) * all_multiplications.Sum(); ErrorSignal = result; }
public virtual void AddDendrites(List <Dendrite> dendrites) { Dendrites.AddRange(dendrites); }
public virtual void AddDendrite(Dendrite dendrite) { Dendrites.Add(dendrite); }
public virtual void Compute() { var sum = Dendrites.Sum(dendrite => dendrite.Value * dendrite.Weight); Axon.Value = Activation(sum); }
public int CountDendrites() { return(Dendrites.Count()); }
public void UpdateWeights(double new_weights) { Dendrites.ToList().ForEach(x => x.SynapticWeight = new_weights); }
public void Calculate() { Value = Dendrites.Sum(x => x.Weight * x.Neuron.Value); }