Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        public void PopulateWithBias(int size, AbstractInputFunction inputFunction = null, AbstractActivationFunction activationFunction = null)
        {
            var bias = new Neurons.BiasNeuron();

            Populate(size, inputFunction, activationFunction);
            AddNeuron(bias);
            hasBias = true;
        }
Ejemplo n.º 3
0
 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();
 }