//Constructor for other neurons //First the other constructor is executed thanks to :this() "self-inheritance" public Neuron(List<Neuron> previousNeurons) : this() { foreach (var previousNeuron in previousNeurons) { var synapse = new Synapse(previousNeuron, this); previousNeuron.OutgoingSynapses.Add(synapse); IncomingSynapses.Add(synapse); } }
public virtual double Calc_Value() { return Value = NeuralNetwork.SigmoidFunction(IncomingSynapses.Sum(a => a.Weight * a.FromNeuron.Value) + Bias); }