static void Main(string[] args)
        {
            string[] tr  = { "112111222123332", "112111222123332", "112111222122322" };
            string[] fal = { "221222111211111", "111111222123432", "111111111111111", "222222222222222", "222222111222222",
                             "122212111212221", "112112111221112", "111111222212222", "222112221122211", "222112221122211",
                             "122211222112221", "112112111212121" };

            Console.Write("Введите количество эпох = ");
            int        epoch = Convert.ToInt32(Console.ReadLine());
            string     trainingRes;
            Perceptron p = new Perceptron(15);

            trainingRes = Train(p, epoch, tr, fal);
            for (int j = 0; j < epoch / 5; j++)
            {
                string f = "";
                if (j % 10 != 0)
                {
                    for (int i = 0; i < 15; i++)
                    {
                        f += p.rnd.Next(0, 9);
                    }
                }
                else
                {
                    if (j % 20 == 0)
                    {
                        Console.WriteLine("Это false");
                        f = fal[p.rnd.Next(fal.Length)];
                    }
                    else
                    {
                        Console.WriteLine("Это true");
                        f = tr[p.rnd.Next(tr.Length)];
                    }
                }
                WritePyramid(f, p.Feed(f));
            }
            Console.WriteLine("\n" + trainingRes + "\n");
            WritePerc(p);
            Console.ReadKey();
        }
 public static void WritePerc(Perceptron p)
 {
     Console.WriteLine("\nВеса:");
     for (int i = 0; i < 3; i++)
     {
         for (int j = 0; j < 5; j++)
         {
             if (p.Weight[5 * i + j] > 0)
             {
                 Console.Write(" " + p.Weight[5 * i + j] + " ");
             }
             else
             {
                 Console.Write(p.Weight[5 * i + j] + " ");
             }
         }
         Console.WriteLine();
     }
     Console.WriteLine("\nBias = " + p.Bias + "      learning rate = " + p.Learning_rate + "\n");
 }
        public static string Train(Perceptron p, int t, string[] tr, string[] fal)
        {
            int  wrongfalse = 0;
            int  wrongpos   = 0;
            int  right      = 0;
            int  rightFirst = 0;
            int  rightSec   = 0;
            int  f          = 0;
            bool x;

            for (int i = 0; i < t; i++)
            {
                if (i % 2 != 0)
                {
                    f = p.rnd.Next(fal.Length);
                    x = p.Feed(fal[f]);
                    WritePyramid(fal[f], x);
                    if (p.Feed(fal[f]))
                    {
                        Console.WriteLine("Неправильно - ложное срабатывание\n\n");
                        wrongpos++;
                        p.DecreaseWhereNeeded(fal[f]);
                    }
                    else
                    {
                        if (i > t / 2)
                        {
                            rightSec++;
                        }
                        else
                        {
                            rightFirst++;
                        }
                        right++;
                    }
                }
                else
                {
                    f = p.rnd.Next(tr.Length);
                    x = p.Feed(tr[f]);
                    WritePyramid(tr[f], x);
                    if (!p.Feed(tr[f]))
                    {
                        Console.WriteLine("Неправильно - не узнал\n\n");
                        wrongfalse++;
                        p.IncreaseWhereNeeded(tr[f]);
                    }
                    else
                    {
                        if (i > t / 2)
                        {
                            rightSec++;
                        }
                        else
                        {
                            rightFirst++;
                        }
                        right++;
                    }
                }
            }
            string res = "Результаты тренировки:\nПравильных = " + right + "\nЛожных срабатываний = " + wrongpos + "\nНе распознано = " + wrongfalse + "\n%Правильных = " + (right * 100 / t) + "%" + "\n%Правильных в  1 половине = " + (rightFirst * 100 / (t / 2)) + "%" + "\n%Правильных во 2 половине = " + (rightSec * 100 / (t / 2)) + "%";

            return(res);
        }