AdvancedOCR.FeedForwardWeights.CompletePreTrainingCore C# (CSharp) Method

CompletePreTrainingCore() protected method

protected CompletePreTrainingCore ( ) : void
return void
        protected override void CompletePreTrainingCore()
        {
            Debug.Assert(PreTrainingSamples > 0);
            double averageHkk = 0;

            double sampleCount = (double)PreTrainingSamples;
            // Divide each of the 2nd derivative sums by the number of samples used to make the estimation, then  convert into step size.
            BiasStepSize = GlobalLearningRate / (GlobalMu + (BiasStepSize / sampleCount));

            for (int i = 0; i < Size; i++)
            {
                double Hkk = WeightStepSize[i] / sampleCount;
                averageHkk += Hkk;
                WeightStepSize[i] = GlobalLearningRate / (GlobalMu + Hkk);
            }

            averageHkk /= (double)(Size);
            System.Diagnostics.Debug.WriteLine("Average Hkk value: " + averageHkk.ToString(), "NNFFInfo");
        }