예제 #1
0
파일: MainForm.cs 프로젝트: servelll/Neuron
        private void LoadTestImagesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            temp_images_mas = LoadData(testpixelFile, testlabelFile);
            double count = 0;

            foreach (DigitImage item in temp_images_mas)
            {
                int[,] arr = NeiroGraphUtils.LeadArray(item.pixels, new int[NeuroWeb.neironInArrayWidth, NeuroWeb.neironInArrayHeight]);
                if (nw.CheckLitera(arr) == Convert.ToString(item.label))
                {
                    count++;
                }
            }
            MessageBox.Show("Коэффициент распознавания тестовой выборки (" + temp_images_mas.Count() + ") = " + 100 * count / temp_images_mas.Count() + "%");
        }
예제 #2
0
파일: MainForm.cs 프로젝트: servelll/Neuron
        private void Act()
        {
            int[,] clipArr = NeiroGraphUtils.CutImageToArray((Bitmap)pictureBox1.Image, new Point(pictureBox1.Width, pictureBox1.Height));
            if (clipArr == null)
            {
                return;
            }
            arr = NeiroGraphUtils.LeadArray(clipArr, new int[NeuroWeb.neironInArrayWidth, NeuroWeb.neironInArrayHeight]);
            pictureBox2.Image = NeiroGraphUtils.GetBitmapFromArr(clipArr);
            pictureBox3.Image = NeiroGraphUtils.GetBitmapFromArr(arr);
            string s = nw.CheckLitera(arr);

            if (s == null)
            {
                s = "null";
            }
            DialogResult askResult;

            if (режимПереобученияToolStripMenuItem.Checked)
            {
                askResult = MessageBox.Show("Результат = " + s + " ?", "", MessageBoxButtons.YesNo);
            }
            else
            {
                askResult = MessageBox.Show("Результат = " + s);
            }
            if (askResult == DialogResult.Yes || !режимПереобученияToolStripMenuItem.Checked)
            {
                return;
            }
            DialogResult askLearn = MessageBox.Show("Переобучить нейросеть на этом примере?", "", MessageBoxButtons.YesNo);

            if (askLearn == DialogResult.No)
            {
                return;
            }
            string s2 = Microsoft.VisualBasic.Interaction.InputBox("Введите верное значение");

            nw.SetTraining(s2, arr, (double)trackBar1.Value / 1000f);
            StatusUpdate();
            Clear();
        }