/// <summary> /// Connect two neurons. This method is used to /// build up connections within the network. The only connection established /// by default is the connection to the bias node. /// </summary> /// <param name="baseNeuron">A base neuron to connect</param> /// <param name="dendrite">A dendrite neuron to connect</param> public void Connect(Neuron baseNeuron, Neuron dendrite) { Axon axon = new Axon(); axon.Base = baseNeuron; axon.Dendrite = dendrite; baseNeuron.AddOutputAxon(axon); dendrite.AddInputAxon(axon); axons.Add(axon); }
/// <summary> /// Connect a neuron to the bias neuron. /// </summary> /// <param name="neuron">The bias neuron</param> private void ConnectToBias(Neuron neuron) { Axon biasAxon = new Axon(); biasAxon.Base = bias; biasAxon.Dendrite = neuron; bias.AddOutputAxon(biasAxon); neuron.AddInputAxon(biasAxon); axons.Add(biasAxon); }