示例#1
0
        public void Entrainement()
        {
            Console.WriteLine("start");
            IndicatorEncog i = new IndicatorEncog(5, 9);

            i.EntrainementReseau();
            Console.WriteLine("save");
            lock (indicatorEncogTest2)
                indicatorEncogTest2.Add(i);
            Console.WriteLine("end");
        }
示例#2
0
        public List <IndicatorEncog> Chargement()
        {
            String       line;
            StreamReader sr = new StreamReader(Path + param);

            line     = sr.ReadLine();
            count    = int.Parse(line);
            line     = sr.ReadLine();
            nbPasse  = int.Parse(line);
            line     = sr.ReadLine();
            nbHidden = int.Parse(line);
            sr.Close();

            List <IndicatorEncog> indicatorEncogTest2 = new List <IndicatorEncog>();

            FileInfo fichier;

            for (int i = 0; i < count; i++)
            {
                IndicatorEncog item = new IndicatorEncog(nbPasse, nbHidden);

                fichier = new FileInfo(Path + reseau + i + ext);
                if (!fichier.Exists)
                {
                    throw new Exception();
                }
                item.Reseau = (BasicNetwork)(Encog.Persist.EncogDirectoryPersistence.LoadObject(fichier));

                fichier = new FileInfo(Path + reseauOptimalEntrainement + i + ext);
                if (!fichier.Exists)
                {
                    throw new Exception();
                }
                item.ReseauOptimalEntrainement = (BasicNetwork)(Encog.Persist.EncogDirectoryPersistence.LoadObject(fichier));

                fichier = new FileInfo(Path + reseauOptimalValidation + i + ext);
                if (!fichier.Exists)
                {
                    throw new Exception();
                }
                item.ReseauOptimalValidation = (BasicNetwork)(Encog.Persist.EncogDirectoryPersistence.LoadObject(fichier));

                indicatorEncogTest2.Add(item);
            }

            return(indicatorEncogTest2);
        }