Exemple #1
0
        /// <summary>
        /// Compute each data results for each layers from the input layer to the output
        /// </summary>
        /// <param name="a">previous data results of a of all layers</param>
        /// <returns>data results of a of all layers</returns>
        public Neuron Feedfoward(Matrix inputs)
        {
            Matrix[] activations = new Matrix[NumberOfLayer];
            Matrix[] zmatrices   = new Matrix[NumberOfLayer - 1];
            activations[0] = inputs;

            for (int l = 0; l < NumberOfLayer - 1; l++)
            {
                zmatrices[l]       = (Weights[l] * activations[l]) + Biases[l];
                activations[l + 1] = Neuron.Sigmoid(zmatrices[l]);
            }

            return(new Neuron {
                Activations = activations, Zmatrices = zmatrices
            });
        }