Exemplo n.º 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 TrainingNumber = neiron.Training(data);
        }
Exemplo n.º 2
0
        private static Neiron NeironCreate(Dictionary <string, object> o)
        {
            Neiron res = new Neiron();

            res.name           = (string)o["name"];
            res.TrainingNumber = (int)o["TrainingNumber"];
            Object[] massData = (Object[])o["mass"];
            int      arrSize  = (int)Math.Sqrt(massData.Length);

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

            for (int n = 0; n < res.mass.GetLength(0); n++)
            {
                for (int m = 0; m < res.mass.GetLength(1); m++)
                {
                    res.mass[n, m] = Double.Parse(massData[index].ToString());
                    index++;
                }
            }
            return(res);
        }