Exemple #1
0
 public NeuronLayer(int iCount, int nCount)
 {
     Neurons    = new Neuron[nCount];
     InputCount = iCount;
     for (int i = 0; i < nCount; i++)
     {
         Neurons[i] = new T.Neuron(iCount);
     }
 }
Exemple #2
0
        /// <summary>
        /// Create a neuron based on a template
        /// </summary>
        /// <param name="neuron"></param>
        public Neuron(T.Neuron neuron, Activation aF = null)
        {
            int dendritesCount = neuron.Dendrites;

            Dendrites = new float[dendritesCount];
            Weights   = new float[dendritesCount];
            for (int i = 0; i < dendritesCount; i++)
            {
                Weights[i] = (float)Rng.GetRng() * -0.1f; /// Will change range dependent into AF
            }
            Bias = 1;                                     //(float) rng.getRng();

            ActivationFunction = aF ?? new Logistic();
            LearningRate       = (float)Rng.GetRng() * 0.05f;
        }