public Neuron(AbstractInputFunction inputFunction = null, AbstractActivationFunction activationFunction = null) { Input = new List <Synapse>(); Output = new List <Synapse>(); InputFunction = inputFunction; if (activationFunction == null) { ActivationFunction = new Sigmoid(); } else { ActivationFunction = activationFunction; } if (InputFunction == null) { InputFunction = new SimpleSum(); } else { InputFunction = inputFunction; } }
public void PopulateWithBias(int size, AbstractInputFunction inputFunction = null, AbstractActivationFunction activationFunction = null) { var bias = new Neurons.BiasNeuron(); Populate(size, inputFunction, activationFunction); AddNeuron(bias); hasBias = true; }
public void Populate(int size, AbstractInputFunction inputFunction = null, AbstractActivationFunction activationFunction = null) { for (int toFill = size - Neurons.Count(); toFill > 0; toFill--) { Neurons.Add(new Neuron(inputFunction, activationFunction)); } Size = Neurons.Count(); }