Студопедия

КАТЕГОРИИ:

АвтоАвтоматизацияАрхитектураАстрономияАудитБиологияБухгалтерияВоенное делоГенетикаГеографияГеологияГосударствоДомЖурналистика и СМИИзобретательствоИностранные языкиИнформатикаИскусствоИсторияКомпьютерыКулинарияКультураЛексикологияЛитератураЛогикаМаркетингМатематикаМашиностроениеМедицинаМенеджментМеталлы и СваркаМеханикаМузыкаНаселениеОбразованиеОхрана безопасности жизниОхрана ТрудаПедагогикаПолитикаПравоПриборостроениеПрограммированиеПроизводствоПромышленностьПсихологияРадиоРегилияСвязьСоциологияСпортСтандартизацияСтроительствоТехнологииТорговляТуризмФизикаФизиологияФилософияФинансыХимияХозяйствоЦеннообразованиеЧерчениеЭкологияЭконометрикаЭкономикаЭлектроникаЮриспунденкция

Текст программы, распознающей 2 класса чисел с помощью двухслойной нейросети.




Текст программы файла Form1.cs представлен на рисунке А.1.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.Threading;

using System.IO;

 

namespace курсовой_титп_2

{

public partial class Form1 : Form

{

   public double[] x1, x2, r;

   Random number = new Random();

   Neyro nr;

   public bool flag = false;  //флаг создания нейросети

   public bool fl_pot = false; //флаг работы потоков

 

   public Thread pp;

   public Thread pp1;

       

   public DateTime dd;

 

   public int mx = 5, my = 100; //Масштаб

   public System.Drawing.Graphics graphicsObj;

   public Pen myPen1 = new Pen(System.Drawing.Color.Red, 1);

   public Pen myPen2 = new Pen(System.Drawing.Color.Black, 1);

 

   public Form1()

   {

       this.x1 = new double[200]; //числа первого класса

       this.x2 = new double[200]; //числа второго класса

       this.r = new double[6]; //рандомные числа

       double sum_r = 0;

           

       for(int i=0; i<200;i++)

       {

           for (int j = 0; j < 6; j++)

           {

               r[j] = number.NextDouble();

               sum_r += r[j];

           }

           x1[i] = (sum_r - 3) / Math.Sqrt(0.5);

           x1[i] = Math.Round(x1[i],3)+2.5;

           x2[i] = x1[i] + 7.5;

 

           sum_r = 0;

       }

 

       InitializeComponent();

   }

Рисунок А.1 – Текст программы файла Form1.cs.

 

       

// ///////////////////////////////////////////

   // кнопка создать сеть

   private void button1_Click(object sender, EventArgs e)

   {

       int neyr1, neyr2;

       double k, skor;

 

       flag = true;

 

       if (textBox1.TextLength != 0)

       {

           neyr1 = Convert.ToInt32(textBox1.Text); //количество нейронов первого слоя

       }

       else

       {

           MessageBox.Show("Введите количество нейронов первого слоя");

           return;

       }

 

       if (textBox2.TextLength != 0)

       {

           neyr2 = Convert.ToInt32(textBox2.Text); //количество нейронов второго слоя

       }

       else

       {

           MessageBox.Show("Введите количество нейронов второго слоя");

           return;

       }

 

       if (textBox9.TextLength != 0)

       {

           k = Convert.ToDouble(textBox9.Text); //коэффицент сигмоида k

       }

       else

       {

           MessageBox.Show("Введите k");

           return;

       }

 

       if (textBox11.TextLength != 0)

       {

           skor = Convert.ToDouble(textBox9.Text); //коэффицент скорости обучения

       }

       else

       {

           MessageBox.Show("Введите skor");

           return;

       }

 

       nr = new Neyro(neyr1, neyr2, k, skor); //вызываем конструктор класса

 

       nr.CreateNS();

           

       //выводим резульат нейросети

       textBox3.Clear();

       for(int i=0; i<neyr2;i++)

       {

           textBox3.AppendText(Convert.ToString(Math.Round(nr.rez[i],3)) +" ");

       }

   }

 

 

   Рисунок А.1 – Продолжение.

   ////////////////////////////////////////////////////////////

   //кнопка сброс

   private void button2_Click(object sender, EventArgs e)

   {

       textBox1.Clear();

       textBox2.Clear();

       textBox3.Clear();

       textBox4.Clear();

           

       textBox6.Clear();

       textBox7.Clear();

       comboBox1.Text = "";

       comboBox2.Text = "";

       comboBox3.Text = "";

       comboBox4.Text = "";

 

   }

 

   // //////////////////////////////////////

   // кнопка обучить 1 класс

   private void button3_Click(object sender, EventArgs e)

   {

           

       string file;

       //int kl = 1;

       string file_osibka = "oshibka.txt";

                       

       if (flag == false)

       {

           MessageBox.Show("Создайте сеть");

           return;

       }

           

       if (comboBox1.Text != "")

       {

           file = comboBox1.Text; //выбранный файл для обучения первого класса

       }

       else

       {

           MessageBox.Show("Выберите файл");

           return;

       }

 

       //создаем файл для вывода ошибки

       FileStream fo = new FileStream(file_osibka, FileMode.Create, FileAccess.Write, FileShare.Write);

       fo.Close();

 

       StreamWriter sw1 = new StreamWriter(file_osibka, true, Encoding.Unicode);

           

 

       nr.Obuchenie(file,sw1);

 

       ///////////////////////////////////////////////

       

       //выводим результат

       textBox3.Clear();

       for (int i = 0; i < nr.neyr2; i++)

       {

           textBox3.AppendText(Convert.ToString(Math.Round(nr.rez[i],3)) + " ");

       }

           

       sw1.Close();

       grafic();

      Рисунок А.1 – Продолжение

  }

 

   // ////////////////////////////////////////////////

   //кнопка результат

 

   private void button4_Click(object sender, EventArgs e)

   {

       double err = 0;

       string file;

       bool[] znach = new bool[nr.neyr2];

       int kl=0;

 

       if (flag == false)

       {

           MessageBox.Show("Создайте сеть");

           return;

       }

 

       for (int i = 0; i < nr.neyr2; i++)

       {

           znach[i] = false;

       }

       

 

       if (comboBox3.Text != "")

       {

           file = comboBox3.Text;

       }

       else

       {

           MessageBox.Show("Выберите файл тестовой выборки");

           return;

       }

 

       string[] text = File.ReadAllLines(file); //читаем содержимое файла в переменную text

 

       for (int i = 0; i < 10; i++)

       {

           nr.vvod[i] = Convert.ToDouble(text[i])/10;

       }

 

       //пересчитываем результат

       nr.Rez();

 

       for (int i = 0; i < nr.neyr2; i++)

       {

           if (nr.rez[i] < 0.5)

               znach[i] = false;

           if (nr.rez[i] > 0.5)

               znach[i] = true;

       }

 

       for (int i = 0; i < nr.neyr2; i++)

       {

           if (znach[i] == nr.ogid1[i])

           {}

           else goto m;

               

       }

       kl = 1;

       m:

 

Рисунок А.1 – Продолжение.

 

       for (int i = 0; i < nr.neyr2; i++)

       {

           if (znach[i] == nr.ogid2[i])

           {}

           else goto m1;

       }

       kl = 2;

       m1:

 

 

       textBox3.Clear();

       for (int i = 0; i < nr.neyr2; i++)

       {

           textBox3.AppendText(Convert.ToString(Math.Round(nr.rez[i],3)) + "  ");

       }

 

       for (int i = 0; i < nr.neyr2; i++)

       {

           err = err + (nr.rez[i] - nr.ogid[i]) * (nr.rez[i] - nr.ogid[i]);

       }

       err = err / 2;

       textBox7.Clear();

       textBox7.AppendText(Convert.ToString(Math.Round(err,3)));

 

       if (kl == 0)

       {

           MessageBox.Show("Класс не определен");

       }

       if (kl == 1)

       {

           MessageBox.Show("Выборка относится к первому классу");

       }

       if (kl == 2)

       {

           MessageBox.Show("Выборка относится ко второму классу");

       }

   }

       

 

   // ////////////////////////////////////////////////////////

   //кнопка создающая файлы

   private void button5_Click(object sender, EventArgs e)

   {

       int nom = 50; //номер файла 1-nom.txt

       int kol = 10; //количество файлов

       int klass = 0; //класс

 

       string[] file=new string[kol];   

       for (int i = 0; i < kol; i++)

       {

           file[i] = "4-" + Convert.ToString(i+nom) + ".txt";

       }

 

       for (int i = 0; i < kol; i++)

       {

           FileStream fl = new FileStream(file[i], FileMode.Create, FileAccess.Write, FileShare.Write);

           fl.Close();

 

 

           StreamWriter sw = new StreamWriter(file[i], true, Encoding.Unicode);

 

           for (int q = 0; q < 20; q++) //100 выборок

   

Рисунок А.1 – Продолжение.

{

               Form1 f = new Form1();

               for (int j = 0; j < 10; j++)

               {

                   sw.WriteLine(f.x2[j]);

               }

           }

           sw.Close();

       }

       Thread.Sleep(5);

   }

 

   // ////////////////////////////////////////////////////////

   // Кнопка Старт для экзамена

   private void button7_Click(object sender, EventArgs e)

   {

       string file;

       bool[] znach = new bool[nr.neyr2];

       int kl = 0;

       int kl_opr = 0;

       double procent = 0;

       double kol = 0;

 

       if (flag == false)

       {

           MessageBox.Show("Создайте сеть");

           return;

       }

 

       for (int i = 0; i < nr.neyr2; i++)

       {

           znach[i] = false;

       }

 

 

       if (comboBox4.Text != "")

       {

           file = comboBox4.Text;

       }

       else

       {

           MessageBox.Show("Выберите файл экзаменационной выборки");

           return;

       }

 

       if (file[0] == '1' || file[0] == '4')

       {

           kl = 1;

       }

       if (file[0] == '2' || file[0] == '3')

       {

           kl = 2;

       }

           

       string[] text = File.ReadAllLines(file); //читаем содержимое файла в переменную text

 

       double[,] chisla = new double[text.Length / 10, 10];

 

       //вносим в матрицу chisla данные из файла

       for (int i = 0; i < text.Length / 10; i++)

           for (int j = 0; j < 10; j++)

            

 

   Рисунок А.1 – Продолжение.

{

               chisla[i, j] = Convert.ToDouble(text[10 * i + j]);

           }

 

       for (int qq = 0; qq < (text.Length / 10); qq++)

       {

           //вносим в массив vvod данные из файла

           for (int i = 0; i < 10; i++)

           {

               nr.vvod[i] = chisla[qq, i]/10;

           }

 

           //пересчитываем результат

           nr.Rez();

 

 

           for (int i = 0; i < nr.neyr2; i++)

           {

               if (nr.rez[i] < 0.5)

                   znach[i] = false;

               if (nr.rez[i] > 0.5)

                   znach[i] = true;

           }

 

           for (int i = 0; i < nr.neyr2; i++)

           {

               if (znach[i] == nr.ogid1[i])

               { }

               else goto m;

 

           }

           kl_opr = 1;

       m:

 

           for (int i = 0; i < nr.neyr2; i++)

           {

               if (znach[i] == nr.ogid2[i])

               { }

               else goto m1;

           }

           kl_opr = 2;

       m1: ;

           if (kl == kl_opr)

           {

               kol++;

                   

           }

           procent = kol / 20;

           procent = procent * 100;

           textBox4.Clear();

           textBox4.AppendText(Convert.ToString(procent));

       }

           

           

   }

 

   ////////////////////////////////////////

   //кнопка выход

   private void button8_Click(object sender, EventArgs e)

   {

       if (fl_pot)

       {

           pp1.Abort();

           pp.Abort();

        Рисунок А.1 – Продолжение.

       Application.Exit();

   }

  

 

// /////////////////////////////////////////////////

// Функция рисующая график

 // ///////////////////////////////

       

   private void grafic()

   {

       int i = 0;

          

       graphicsObj = this.CreateGraphics();

       graphicsObj.Clear(System.Drawing.SystemColors.Control);

       textBox10.Clear();

 

       graphicsObj.DrawLine(myPen2, 480, 250, 1000, 250);

       graphicsObj.DrawLine(myPen2, 500, 30, 500, 270);

       for (int xx = 1; xx < 20; xx++)

       {

           delenie(xx, xx, 0.2, -0.2, (mx*5));

       }

 

       for (double yy = -2; yy <= 0; yy++)

       {

           delenie(0.05, -0.05, yy, yy, my);

       }

 

       for (i = 0; i < 99; i++)

       {

           graphicsObj.DrawLine(myPen1, m_x(i), m_y(nr.err_m[i]), m_x((i) + 1), m_y(nr.err_m[i + 1]));

           textBox10.AppendText(Convert.ToString(i) + " " + Convert.ToString(Math.Round(nr.err_m[i],5)));

           textBox10.AppendText("\r\n");

       }

       textBox10.AppendText(Convert.ToString(99) + " " + Convert.ToString(Math.Round(nr.err_m[99], 5)));

   }

 

   private float m_x(double a)

   {

       float b;

       b = Convert.ToInt32(a * mx + 500);

       return b;

   }

 

   private float m_y(double a)

   {

       float b;

       b = Convert.ToInt32(a * (-1) * my + 250);

       return b;

   }

   private void delenie(double x1, double x2, double y1, double y2, int m)

   {

       x1 = x1 * m + 500;

       x2 = x2 * m + 500;

       y1 = y1 * m + 250;

       y2 = y2 * m + 250;

       graphicsObj.DrawLine(myPen2, Convert.ToInt32(x1), Convert.ToInt32(y1), Convert.ToInt32(x2), Convert.ToInt32(y2));

   }

 

}

Рисунок А.1 – Продолжение.

//класс, который работает с нейросетью

public class Neyro : Form1

{

   public double[] prom, vvod;

   public double[,] w1, w2;

   public double[] rez;

   public int count1=0, count2=0;

   public int neyr1, neyr2;

   public int[] ogid;

   public bool[] ogid1, ogid2;

   public double k, skor;

   public double[] err_m = new double[100];

       

 

   //конструктор. при создании объекта класса задаем параметры матриц

   public Neyro(int neyr1, int neyr2, double k, double skor)

   {

       this.neyr1 = neyr1;

       this.neyr2 = neyr2;

       this.k = k;

       this.skor = skor;

           

       this.ogid = new int[neyr2];

       this.ogid1 = new bool[neyr2];

       this.ogid2 = new bool[neyr2];

       this.w1 = new double[10, neyr1];

       this.w2 = new double[neyr1, neyr2];

       this.prom = new double[neyr1];

       this.vvod = new double[10];

       this.rez = new double[neyr2];

          

 

       Random number = new Random();

       

       //Заполнение матрицы весовых коэффицентов w1

       for (int q = 0; q < 10; q++)

       {

           for (int p = 0; p < neyr1; p++)

           {

               w1[q, p] = number.NextDouble()-0.5;

           }

       }

 

       //Заполнение матрицы весовых коэффицентов w2

       for (int q = 0; q < neyr1; q++)

       {

           for (int p = 0; p < neyr2; p++)

           {

               w2[q, p] = number.NextDouble()-0.5;

            }

       }

           

 

       ogid1[0] = false;

       for (int i = 1; i < neyr2; i++)

       {

           if (ogid1[i - 1] == false)

               ogid1[i] = true;

           else ogid1[i] = false;

       }

 

       ogid2[0] = true;

       for (int i = 1; i < neyr2; i++)

           

   Рисунок А.1 – Продолжение.

{

           if (ogid2[i - 1] == false)

               ogid2[i] = true;

           else ogid2[i] = false;

       }

                       

   }

      

   //код, который будет выполняться в потоке

   public void Potok1(object _Data)

   {

           

       double sum1 = 0;

 

       for (int n = 0; n < (neyr1 / 2); n++)

       {

           for (int i = 0; i < 10; i++)

           {

               sum1 = sum1 + (vvod[i] * w1[i, n]);

           }

 

           prom[n] = Math.Round(1 / (1 + Math.Exp((-sum1)*k)), 3);

       }

       count1++;

   }

 

   public void Potok2(object _Data)

   {

 

       double sum2 = 0;

 

       for (int n = (neyr1 / 2); n < neyr1; n++)

       {

           for (int i = 0; i < 10; i++)

           {

               sum2 = sum2 + (vvod[i] * w1[i, n]);

           }

 

           prom[n] = 1 / (1 + Math.Exp((-sum2)*k));

       }

       count1++;

   }

 

   public void Potok3(object _Data)

   {

           

       double sum1 = 0;

       for (int n = 0; n < (neyr2 / 2); n++)

       {

           for (int i = 0; i < neyr1; i++)

           {

               sum1 = sum1 + (prom[i] * w2[i, n]);

           }

 

           rez[n] = 1 / (1 + Math.Exp((-sum1)*k));

       }

       count2++;

   }

 

   public void Potok4(object _Data)

   {

 

       double sum2 = 0;

       for (int n = (neyr2 / 2); n < neyr2; n++)

       Рисунок А.1 – Продолжение.

 

{

           for (int i = 0; i < neyr1; i++)

           {

               sum2 = sum2 + (prom[i] * w2[i, n]);

           }

 

           rez[n] = 1 / (1 + Math.Exp((-sum2)*k));

       }

       count2++;

   }

 

   public int[] Vihod(int kol, int kl) //функция формирует ожидаемые значения

   {

       int a=0;

 

       if (kl == 2 || kl==3)

           a = 1;

           

       int[]mas=new int[kol];

       for (int i = 0; i < kol; i++)

       {

           mas[i] = a;

           if (a == 0)

               a = 1;

           else a = 0;

       }

       return mas;               

 

   }

 

   public void Korekt() //коректировка весов матриц

   {

       double[] beta2 = new double[neyr2];

       double[] beta1 = new double[neyr1];

       //double skor = 0.5;

       double summa = 0;

 

       //ощибка выходного слоя

       for (int q = 0; q < neyr2; q++)

       {

           beta2[q] = (ogid[q] - rez[q]) * (1 - rez[q]) * rez[q];

       }

 

       //коректировка весов матрицы w2

       for (int p = 0; p < neyr1; p++)

       {

           for (int q = 0; q < neyr2; q++)

           {

               w2[p, q] = (w2[p, q] + skor * beta2[q] * prom[p]);

               if (w2[p, q] == 0)

               {

                   w2[p, q] = 0.1;

               }

           }

       }

 

       //ошибка промежуточного слоя

       summa = 0;

       for (int q = 0; q < neyr1; q++)

       {

           for (int k = 0; k < neyr2; k++)

           {

               summa = summa + beta2[k] * w2[q, k];

        Рисунок А.1 – Продолжение.

 

}

           beta1[q] = (1 - prom[q]) * prom[q] * summa;

           summa = 0;

       }

 

       //коректировка весов матрицы w1

       for (int p = 0; p < 10; p++)

       {

           for (int q = 0; q < neyr1; q++)

           {

               w1[p, q] = (w1[p, q] + skor * beta1[q] * vvod[p]);

               if (w1[p, q] == 0)

               {

                   w1[p, q] = 0.1;

               }

           }

       }           

   }

 

   public void Rez()

   {

       //пересчитываем результат

       Thread th_11 = new Thread(Potok1);

       Thread th_22 = new Thread(Potok2);

           

       th_11.Start("11");

       th_22.Start("22");

 

       while (count1 != 2) { }

       count1 = 0;

 

       Thread th_33 = new Thread(Potok3);

       Thread th_44 = new Thread(Potok4);

 

       th_33.Start("33");

      th_44.Start("44");

 

       while (count2 != 2) { }

       count2 = 0;

   }

 

   public void CreateNS()

   {

   

       string[] text = File.ReadAllLines("1-1.txt"); //читаем содержимое файла в переменную text

          

       for (int i = 0; i < 10; i++)

       {

           vvod[i] = Convert.ToDouble(text[i])/10; //создаем массив входных значений

       }

 

       //считаем результат

       Rez();

   }

 

   public void Obuchenie(string file, StreamWriter sw1)

   {

       double err = 0;

       int klass = 0;

       int ee = 0;

 

       Рисунок А.1 – Продолжение.

 

       string[] text = File.ReadAllLines(file); //читаем содержимое файла в переменную text

 

       /*double[,] chisla = new double[text.Length / 10, 10];

 

       //вносим в матрицу chisla данные из файла

       for (int i = 0; i < text.Length / 10; i++)

           for (int j = 0; j < 10; j++)

           {

               chisla[i, j] = Convert.ToDouble(text[10 * i + j]);

           }

       */

 

       for (int qq = 0; qq < 1100; )

       {

           klass = Convert.ToInt32(text[qq]);

           qq++;

 

           ogid = Vihod(neyr2, klass); //создаем функцию которая должна получится

 

           for (int i = 0; i < 10; i++)

           {

               vvod[i] = Convert.ToDouble(text[qq])/10;

               qq++;

           }

 

 

           Rez(); //пересчитываем результат

           Korekt(); //коректируем веса

           Rez(); //еще раз пересчитываем результат

             

           //считаем ошибку

           err = 0;

               

           for (int i = 0; i < neyr2; i++)

           {

               err = err + (rez[i] - ogid[i]) * (rez[i] - ogid[i]);

           }

           err = err / 2;

 

           err_m[ee] = err; //записываем все ошибки в массив

           ee++;

 

           //выводим ошибку

           textBox7.Clear();

           textBox7.AppendText(Convert.ToString(Math.Round(err, 5)));

 

          //выводим ошибку в файл

           sw1.Write(Convert.ToString(Math.Round(err, 5)) + " ");

 

       }

       sw1.WriteLine();

   }

}

}

 

   Рисунок А.1 – Продолжение.

 

Текст программы Form1.Designer.cs представлен на рисунке А4.

           

namespace курсовой_титп_2

{

partial class Form1

{

   /// <summary>

   /// Required designer variable.

   /// </summary>

   private System.ComponentModel.IContainer components = null;

 

   /// <summary>

   /// Clean up any resources being used.

   /// </summary>

   /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>

   protected override void Dispose(bool disposing)

   {

       if (disposing && (components != null))

       {

           components.Dispose();

       }

       base.Dispose(disposing);

   }

 

   #region Windows Form Designer generated code

 

   /// <summary>

   /// Required method for Designer support - do not modify

   /// the contents of this method with the code editor.

   /// </summary>

   private void InitializeComponent()

   {

       this.comboBox1 = new System.Windows.Forms.ComboBox();

       this.label4 = new System.Windows.Forms.Label();

       this.comboBox2 = new System.Windows.Forms.ComboBox();

       this.label5 = new System.Windows.Forms.Label();

       this.label6 = new System.Windows.Forms.Label();

       this.textBox3 = new System.Windows.Forms.TextBox();

      this.button2 = new System.Windows.Forms.Button();

       this.button3 = new System.Windows.Forms.Button();

       this.button4 = new System.Windows.Forms.Button();

       this.label7 = new System.Windows.Forms.Label();

       this.label8 = new System.Windows.Forms.Label();

       this.comboBox3 = new System.Windows.Forms.ComboBox();

       this.textBox6 = new System.Windows.Forms.TextBox();

       this.button5 = new System.Windows.Forms.Button();

       this.textBox7 = new System.Windows.Forms.TextBox();

       this.button6 = new System.Windows.Forms.Button();

       this.label9 = new System.Windows.Forms.Label();

       this.label10 = new System.Windows.Forms.Label();

       this.label11 = new System.Windows.Forms.Label();

       this.comboBox4 = new System.Windows.Forms.ComboBox();

       this.textBox4 = new System.Windows.Forms.TextBox();

       this.label12 = new System.Windows.Forms.Label();

       this.button7 = new System.Windows.Forms.Button();

       this.label13 = new System.Windows.Forms.Label();

       this.button8 = new System.Windows.Forms.Button();

       this.label14 = new System.Windows.Forms.Label();

       this.label1 = new System.Windows.Forms.Label();

       

 

Рисунок А.2- Текст программы Form1.Designer.cs.

     this.textBox1 = new System.Windows.Forms.TextBox();

       this.textBox2 = new System.Windows.Forms.TextBox();

       this.label2 = new System.Windows.Forms.Label();

       this.label3 = new System.Windows.Forms.Label();

       this.button1 = new System.Windows.Forms.Button();

       this.button9 = new System.Windows.Forms.Button();

       this.textBox5 = new System.Windows.Forms.TextBox();

       this.textBox8 = new System.Windows.Forms.TextBox();

       this.textBox9 = new System.Windows.Forms.TextBox();

       this.label15 = new System.Windows.Forms.Label();

       this.textBox10 = new System.Windows.Forms.TextBox();

       this.textBox11 = new System.Windows.Forms.TextBox();

       this.label16 = new System.Windows.Forms.Label();

       this.SuspendLayout();

       //

       // comboBox1

       //

       this.comboBox1.FormattingEnabled = true;

       this.comboBox1.Items.AddRange(new object[] {

       "1-100.txt",

       "1-101.txt",

       "1-102.txt",

       "1-103.txt",

       "1-104.txt",

       "1-300.txt",

       "1-301.txt",

       "1-302.txt",

       "1-303.txt",

       "1-304.txt"});

       this.comboBox1.Location = new System.Drawing.Point(163, 111);

       this.comboBox1.Name = "comboBox1";

       this.comboBox1.Size = new System.Drawing.Size(121, 21);

       this.comboBox1.TabIndex = 3;

       //

       // label4

       //

       this.label4.AutoSize = true;

       this.label4.Location = new System.Drawing.Point(44, 114);

       this.label4.Name = "label4";

       this.label4.Size = new System.Drawing.Size(113, 13);

       this.label4.TabIndex = 0;

       this.label4.Text = "Обучающая выборка";

       //

       // comboBox2

       //

       this.comboBox2.FormattingEnabled = true;

       this.comboBox2.Items.AddRange(new object[] {

       "2-20.txt",

       "2-21.txt",

       "2-22.txt",

       "2-23.txt",

       "2-24.txt",

       "2-25.txt",

       "2-26.txt",

       "2-27.txt",

       "2-28.txt",

       "2-29.txt"});

       this.comboBox2.Location = new System.Drawing.Point(317, 111);

       this.comboBox2.Name = "comboBox2";

       this.comboBox2.Size = new System.Drawing.Size(121, 21);

       this.comboBox2.TabIndex = 3;

       this.comboBox2.Visible = false;

       

 

Рисунок А.2- Продолжение.

       // label5

       //

       this.label5.AutoSize = true;

       this.label5.Location = new System.Drawing.Point(192, 95);

       this.label5.Name = "label5";

       this.label5.Size = new System.Drawing.Size(47, 13);

       this.label5.TabIndex = 2;

       this.label5.Text = "Класс 1";

       //

       // label6

       //

       this.label6.AutoSize = true;

       this.label6.Location = new System.Drawing.Point(341, 95);

       this.label6.Name = "label6";

       this.label6.Size = new System.Drawing.Size(47, 13);

       this.label6.TabIndex = 2;

       this.label6.Text = "Класс 2";

       this.label6.Visible = false;

       //

       // textBox3

       //

       this.textBox3.Location = new System.Drawing.Point(163, 187);

       this.textBox3.Name = "textBox3";

       this.textBox3.Size = new System.Drawing.Size(275, 20);

       this.textBox3.TabIndex = 1;

       //

       // button2

       //

       this.button2.Location = new System.Drawing.Point(98, 468);

       this.button2.Name = "button2";

       this.button2.Size = new System.Drawing.Size(75, 23);

       this.button2.TabIndex = 5;

       this.button2.Text = "Сброс";

       this.button2.UseVisualStyleBackColor = true;

       this.button2.Click += new System.EventHandler(this.button2_Click);

       //

       // button3

       //

       this.button3.Location = new System.Drawing.Point(181, 147);

       this.button3.Name = "button3";

       this.button3.Size = new System.Drawing.Size(75, 23);

       this.button3.TabIndex = 6;

       this.button3.Text = "Обучить";

       this.button3.UseVisualStyleBackColor = true;

       this.button3.Click += new System.EventHandler(this.button3_Click);

       //

       // button4

       //

       this.button4.Location = new System.Drawing.Point(313, 406);

       this.button4.Name = "button4";

       this.button4.Size = new System.Drawing.Size(75, 23);

       this.button4.TabIndex = 8;

       this.button4.Text = "Результат";

       this.button4.UseVisualStyleBackColor = true;

       this.button4.Click += new System.EventHandler(this.button4_Click);

       //

       // label7

       //

       this.label7.AutoSize = true;

       this.label7.Location = new System.Drawing.Point(55, 411);

       this.label7.Name = "label7";

       this.label7.Size = new System.Drawing.Size(102, 13);

       this.label7.TabIndex = 0;

       this.label7.Text = "Тестовая выборка";

     Рисунок А.2- Продолжение.

 

       // label8

       //

       this.label8.AutoSize = true;

       this.label8.Location = new System.Drawing.Point(203, 392);

       this.label8.Name = "label8";

       this.label8.Size = new System.Drawing.Size(36, 13);

       this.label8.TabIndex = 2;

       this.label8.Text = "Файл";

       //

       // comboBox3

       //

       this.comboBox3.FormattingEnabled = true;

       this.comboBox3.Items.AddRange(new object[] {

       "1-1.txt",

       "1-2.txt",

       "1-3.txt",

       "1-4.txt",

       "1-5.txt",

       "1-6.txt",

       "1-7.txt",

       "1-8.txt",

       "1-9.txt",

       "1-10.txt",

       "1-11.txt",

       "1-12.txt",

       "1-13.txt",

       "1-14.txt",

       "1-15.txt",

       "1-16.txt",

       "1-17.txt",

       "1-18.txt",

       "1-19.txt",

       "2-1.txt",

       "2-2.txt",

       "2-3.txt",

       "2-4.txt",

       "2-5.txt",

       "2-6.txt",

       "2-7.txt",

       "2-8.txt",

       "2-9.txt",

       "2-10.txt",

       "2-11.txt",

       "2-12.txt",

       "2-13.txt",

       "2-14.txt",

       "2-15.txt",

       "2-16.txt",

       "2-17.txt",

       "2-18.txt",

       "2-19.txt"});

       this.comboBox3.Location = new System.Drawing.Point(161, 408);

       this.comboBox3.Name = "comboBox3";

       this.comboBox3.Size = new System.Drawing.Size(121, 21);

       this.comboBox3.TabIndex = 3;

       //

       // textBox6

       //

       this.textBox6.Location = new System.Drawing.Point(163, 239);

       this.textBox6.Name = "textBox6";

       this.textBox6.Size = new System.Drawing.Size(148, 20);

       this.textBox6.TabIndex = 1;

          

Рисунок А.2- Продолжение.

       // button5

       //

       this.button5.Location = new System.Drawing.Point(189, 468);

       this.button5.Name = "button5";

       this.button5.Size = new System.Drawing.Size(94, 23);

       this.button5.TabIndex = 9;

       this.button5.Text = "Создать файлы";

       this.button5.UseVisualStyleBackColor = true;

       this.button5.Click += new System.EventHandler(this.button5_Click);

       //

       // textBox7

       //

       this.textBox7.Location = new System.Drawing.Point(385, 239);

       this.textBox7.Name = "textBox7";

       this.textBox7.Size = new System.Drawing.Size(53, 20);

       this.textBox7.TabIndex = 1;

       //

       // button6

       //

       this.button6.Location = new System.Drawing.Point(344, 147);

       this.button6.Name = "button6";

       this.button6.Size = new System.Drawing.Size(75, 23);

       this.button6.TabIndex = 10;

       this.button6.Text = "Обучить";

       this.button6.UseVisualStyleBackColor = true;

       this.button6.Visible = false;

       this.button6.Click += new System.EventHandler(this.button6_Click);

       //

       // label9

       //

       this.label9.AutoSize = true;

       this.label9.Location = new System.Drawing.Point(332, 242);

       this.label9.Name = "label9";

       this.label9.Size = new System.Drawing.Size(47, 13);

       this.label9.TabIndex = 0;

       this.label9.Text = "Ошибка";

       //

       // label10

       //

       this.label10.AutoSize = true;

       this.label10.Location = new System.Drawing.Point(10, 312);

       this.label10.Name = "label10";

       this.label10.Size = new System.Drawing.Size(147, 13);

       this.label10.TabIndex = 0;

       this.label10.Text = "Экзаменационная выборка";

       //

       // label11

       //

       this.label11.AutoSize = true;

       this.label11.Location = new System.Drawing.Point(203, 293);

       this.label11.Name = "label11";

       this.label11.Size = new System.Drawing.Size(36, 13);

       this.label11.TabIndex = 2;

       this.label11.Text = "Файл";

       //

       // comboBox4

       //

       this.comboBox4.FormattingEnabled = true;

       this.comboBox4.Items.AddRange(new object[] {

       "1-50.txt",

       "1-51.txt",

       "1-52.txt",

       "1-53.txt",

           

Рисунок А.2- Продолжение.

 

"1-54.txt",

       "1-55.txt",

       "1-56.txt",

       "1-57.txt",

       "1-58.txt",

       "1-59.txt",

       "2-50.txt",

       "2-51.txt",

       "2-52.txt",

       "2-53.txt",

       "2-54.txt",

       "2-55.txt",

       "2-56.txt",

       "2-57.txt",

       "2-58.txt",

       "2-59.txt",

       "3-50.txt",

       "3-51.txt",

       "3-52.txt",

       "3-53.txt",

       "3-54.txt",

       "3-55.txt",

       "3-56.txt",

       "3-57.txt",

       "3-58.txt",

       "3-59.txt",

       "4-50.txt",

       "4-51.txt",

       "4-52.txt",

       "4-53.txt",

       "4-54.txt",

       "4-55.txt",

       "4-56.txt",

       "4-57.txt",

       "4-58.txt",

       "4-59.txt"});

       this.comboBox4.Location = new System.Drawing.Point(161, 309);

       this.comboBox4.Name = "comboBox4";

       this.comboBox4.Size = new System.Drawing.Size(121, 21);

       this.comboBox4.TabIndex = 3;

       //

       // textBox4

       //

       this.textBox4.Location = new System.Drawing.Point(161, 350);

       this.textBox4.Name = "textBox4";

       this.textBox4.Size = new System.Drawing.Size(121, 20);

       this.textBox4.TabIndex = 11;

       //

       // label12

       //

       this.label12.AutoSize = true;

       this.label12.Location = new System.Drawing.Point(107, 353);

       this.label12.Name = "label12";

       this.label12.Size = new System.Drawing.Size(50, 13);

       this.label12.TabIndex = 0;

       this.label12.Text = "Процент";

       //

       // button7

       //

       this.button7.Location = new System.Drawing.Point(313, 325);

       this.button7.Name = "button7";

       this.button7.Size = new System.Drawing.Size(75, 23);

          

Рисунок А.2- Продолжение.

 

 this.button7.TabIndex = 12;

       this.button7.Text = "Старт";

       this.button7.UseVisualStyleBackColor = true;

       this.button7.Click += new System.EventHandler(this.button7_Click);

       //

       // label13

       //

       this.label13.AutoSize = true;

       this.label13.Location = new System.Drawing.Point(43, 190);

       this.label13.Name = "label13";

       this.label13.Size = new System.Drawing.Size(114, 13);

       this.label13.TabIndex = 0;

       this.label13.Text = "Результат на выходе";

       //

       // button8

       //

       this.button8.Location = new System.Drawing.Point(304, 468);

       this.button8.Name = "button8";

       this.button8.Size = new System.Drawing.Size(75, 23);

       this.button8.TabIndex = 13;

       this.button8.Text = "Выход";

       this.button8.UseVisualStyleBackColor = true;

       this.button8.Click += new System.EventHandler(this.button8_Click);

       //

       // label14

       //

       this.label14.AutoSize = true;

       this.label14.Location = new System.Drawing.Point(34, 242);

       this.label14.Name = "label14";

       this.label14.Size = new System.Drawing.Size(123, 13);

       this.label14.TabIndex = 0;

       this.label14.Text = "Ожидаемый результат";

       //

       // label1

       //

       this.label1.AutoSize = true;

       this.label1.Location = new System.Drawing.Point(40, 51);

       this.label1.Name = "label1";

       this.label1.Size = new System.Drawing.Size(117, 13);

       this.label1.TabIndex = 0;

       this.label1.Text = "Количество нейронов";

       //

       // textBox1

       //

       this.textBox1.Location = new System.Drawing.Point(163, 48);

       this.textBox1.Name = "textBox1";

       this.textBox1.Size = new System.Drawing.Size(35, 20);

       this.textBox1.TabIndex = 1;

       this.textBox1.Text = "15";

       //

       // textBox2

       //

       this.textBox2.Location = new System.Drawing.Point(204, 48);

       this.textBox2.Name = "textBox2";

       this.textBox2.Size = new System.Drawing.Size(35, 20);

       this.textBox2.TabIndex = 1;

       this.textBox2.Text = "4";

       //

       // label2

       //

       this.label2.AutoSize = true;

       this.label2.Location = new System.Drawing.Point(158, 32);

          

Рисунок А.2- Продолжение.

 

 this.label2.Name = "label2";

       this.label2.Size = new System.Drawing.Size(40, 13);

       this.label2.TabIndex = 2;

       this.label2.Text = "1 слой";

       //

       // label3

       //

       this.label3.AutoSize = true;

       this.label3.Location = new System.Drawing.Point(201, 33);

       this.label3.Name = "label3";

       this.label3.Size = new System.Drawing.Size(40, 13);

       this.label3.TabIndex = 2;

          this.label3.Text = "2 слой";

       //

       // button1

       //

       this.button1.Location = new System.Drawing.Point(344, 45);

       this.button1.Name = "button1";

       this.button1.Size = new System.Drawing.Size(89, 23);

       this.button1.TabIndex = 4;

       this.button1.Text = "Создать сеть";

       this.button1.UseVisualStyleBackColor = true;

       this.button1.Click += new System.EventHandler(this.button1_Click);

       //

       // button9

       //

       this.button9.Location = new System.Drawing.Point(448, 46);

       this.button9.Name = "button9";

       this.button9.Size = new System.Drawing.Size(33, 23);

       this.button9.TabIndex = 14;

       this.button9.UseVisualStyleBackColor = true;

       this.button9.Visible = false;

       this.button9.Click += new System.EventHandler(this.button9_Click);

       //

       // textBox5

       //

       this.textBox5.Location = new System.Drawing.Point(394, 85);

       this.textBox5.Name = "textBox5";

       this.textBox5.Size = new System.Drawing.Size(90, 20);

       this.textBox5.TabIndex = 15;

       this.textBox5.Visible = false;

       //

       // textBox8

       //

       this.textBox8.Location = new System.Drawing.Point(413, 12);

       this.textBox8.Name = "textBox8";

       this.textBox8.Size = new System.Drawing.Size(68, 20);

       this.textBox8.TabIndex = 16;

       this.textBox8.Visible = false;

       //

       // textBox9

       //

       this.textBox9.Location = new System.Drawing.Point(245, 48);

       this.textBox9.Name = "textBox9";

       this.textBox9.Size = new System.Drawing.Size(35, 20);

       this.textBox9.TabIndex = 1;

       this.textBox9.Text = "1,3";

       //

       // label15

       //

       this.label15.AutoSize = true;

       this.label15.Location = new System.Drawing.Point(256, 33);

        

Рисунок А.2- Продолжение.

     this.label15.Name = "label15";

       this.label15.Size = new System.Drawing.Size(13, 13);

       this.label15.TabIndex = 2;

       this.label15.Text = "k";

       //

       // textBox10

       //

       this.textBox10.Location = new System.Drawing.Point(494, 293);

       this.textBox10.Multiline = true;

       this.textBox10.Name = "textBox10";

       this.textBox10.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;

       this.textBox10.Size = new System.Drawing.Size(303, 169);

       this.textBox10.TabIndex = 17;

       //

       // textBox11

       //

       this.textBox11.Location = new System.Drawing.Point(286, 48);

       this.textBox11.Name = "textBox11";

       this.textBox11.Size = new System.Drawing.Size(35, 20);

       this.textBox11.TabIndex = 1;

       this.textBox11.Text = "0,7";

       //

       // label16

       //

       this.label16.AutoSize = true;

       this.label16.Location = new System.Drawing.Point(284, 32);

       this.label16.Name = "label16";

       this.label16.Size = new System.Drawing.Size(27, 13);

       this.label16.TabIndex = 2;

       this.label16.Text = "skor";

       //

       // Form1

       //

       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

       this.BackColor = System.Drawing.SystemColors.Control;

       this.ClientSize = new System.Drawing.Size(1024, 506);

       this.Controls.Add(this.textBox10);

       this.Controls.Add(this.textBox8);

       this.Controls.Add(this.textBox5);

       this.Controls.Add(this.button9);

       this.Controls.Add(this.button8);

       this.Controls.Add(this.button7);

       this.Controls.Add(this.textBox4);

       this.Controls.Add(this.button6);

       this.Controls.Add(this.button5);

       this.Controls.Add(this.button4);

       this.Controls.Add(this.button3);

       this.Controls.Add(this.button2);

       this.Controls.Add(this.button1);

       this.Controls.Add(this.comboBox2);

       this.Controls.Add(this.comboBox4);

       this.Controls.Add(this.comboBox3);

       this.Controls.Add(this.comboBox1);

       this.Controls.Add(this.label11);

       this.Controls.Add(this.label16);

       this.Controls.Add(this.label15);

       this.Controls.Add(this.label3);

       this.Controls.Add(this.label8);

       this.Controls.Add(this.label6);

       this.Controls.Add(this.label5);

       this.Controls.Add(this.label2);

       this.Controls.Add(this.textBox11);

        

Рисунок А.2- Продолжение.

 

  this.Controls.Add(this.textBox9);

       this.Controls.Add(this.textBox2);

       this.Controls.Add(this.textBox7);

       this.Controls.Add(this.textBox6);

       this.Controls.Add(this.label12);

       this.Controls.Add(this.label10);

       this.Controls.Add(this.textBox3);

       this.Controls.Add(this.label7);

       this.Controls.Add(this.textBox1);

       this.Controls.Add(this.label9);

       this.Controls.Add(this.label14);

       this.Controls.Add(this.label13);

       this.Controls.Add(this.label4);

       this.Controls.Add(this.label1);

       this.Name = "Form1";

       this.Text = "Form1";

       this.ResumeLayout(false);

       this.PerformLayout();

 

   }

   #endregion

   private System.Windows.Forms.ComboBox comboBox1;

   private System.Windows.Forms.Label label4;

   private System.Windows.Forms.ComboBox comboBox2;

   private System.Windows.Forms.Label label5;

   private System.Windows.Forms.Label label6;

   private System.Windows.Forms.TextBox textBox3;

   private System.Windows.Forms.Button button2;

   private System.Windows.Forms.Button button3;

   private System.Windows.Forms.Button button4;

   private System.Windows.Forms.Label label7;

   private System.Windows.Forms.Label label8;

   private System.Windows.Forms.ComboBox comboBox3;

   private System.Windows.Forms.TextBox textBox6;

   private System.Windows.Forms.Button button5;

   public System.Windows.Forms.TextBox textBox7;

   private System.Windows.Forms.Button button6;

   private System.Windows.Forms.Label label9;

   private System.Windows.Forms.Label label10;

   private System.Windows.Forms.Label label11;

   private System.Windows.Forms.ComboBox comboBox4;

   private System.Windows.Forms.TextBox textBox4;

   private System.Windows.Forms.Label label12;

   private System.Windows.Forms.Button button7;

   private System.Windows.Forms.Label label13;

   private System.Windows.Forms.Button button8;

   private System.Windows.Forms.Label label14;

   private System.Windows.Forms.Label label1;

   private System.Windows.Forms.TextBox textBox1;

   private System.Windows.Forms.TextBox textBox2;

   private System.Windows.Forms.Label label2;

   private System.Windows.Forms.Label label3;

   private System.Windows.Forms.Button button1;

   private System.Windows.Forms.Button button9;

   public System.Windows.Forms.TextBox textBox5;

   private System.Windows.Forms.TextBox textBox8;

   private System.Windows.Forms.TextBox textBox9;

   private System.Windows.Forms.Label label15;

   private System.Windows.Forms.TextBox textBox10;

   private System.Windows.Forms.TextBox textBox11;

   private System.Windows.Forms.Label label16;

  

 Рисунок А.2- Продолжение.










Последнее изменение этой страницы: 2018-04-12; просмотров: 404.

stydopedya.ru не претендует на авторское право материалов, которые вылажены, но предоставляет бесплатный доступ к ним. В случае нарушения авторского права или персональных данных напишите сюда...