Пример #1
0
        public void SetTraining(string trainingName, int[,] data)
        {
            Neiron neiron = neironArray.Find(v => v.name.Equals(trainingName));

            if (neiron == null)
            {
                neiron = new Neiron();
                neiron.Clear(trainingName, neironInArrayWidth, neironInArrayHeight);
                neironArray.Add(neiron);
            }
            int    countTrainig = neiron.Training(data);
            string messageStr   = "Имя образа - " + neiron.GetName() +
                                  " вариантов образа в памяти - " + countTrainig.ToString();


            Form resultForm = new ShowMemoryVeight(neiron);

            resultForm.Text = messageStr;
            resultForm.Show();
        }
Пример #2
0
        private static Neiron NeironCreate(Dictionary <string, object> o)
        {
            Neiron res = new Neiron();

            res.name         = (string)o["name"];
            res.countTrainig = (int)o["countTrainig"];
            Object[] veightData = (Object[])o["veight"];
            int      arrSize    = (int)Math.Sqrt(veightData.Length);

            res.veight = new double[arrSize, arrSize];
            int index = 0;

            for (int n = 0; n < res.veight.GetLength(0); n++)
            {
                for (int m = 0; m < res.veight.GetLength(1); m++)
                {
                    res.veight[n, m] = Double.Parse(veightData[index].ToString());
                    index++;
                }
            }
            return(res);
        }
 public ShowMemoryVeight(Neiron neiron)
 {
     InitializeComponent();
     this.neiron = neiron;
 }