コード例 #1
0
        private void bnRecognize_Click(object sender, EventArgs e)
        {
            double[] task = RawSample.BitmapToInputs(bmp, nx, ny);

            double[] result = charNet.FeedForward(task);

            char[] ans = chars.ToCharArray();
            Array.Sort(result, ans);

            txtAnswer.Text = ans[ans.Length - 1].ToString();
            labelSure.Text = (result[ans.Length - 1] * 100).ToString("F5") + "%";
            //Debug.Print(result.ToString());
        }
コード例 #2
0
        protected override double CalcFinalFunc()
        {
            double[] smpOutput, smpInput;
            double netError = 0;

            for (int i = 0; i < samplesToPass; i++)
            {
                samples.GetRandomSample(out smpInput, out smpOutput);

                double[] netOutput = charNetwork.FeedForward(smpInput);
                netError += CharRecognizerNetwork.CalculateError(smpOutput, netOutput);
            }

            // TODO try 1/netError
            return -netError;
        }