Exemplo n.º 1
0
        private void RadialNeuralLearn()
        {
            if (learningDocInfo != null && learningDocInfo.SourceDir != Settings.Default.pathLearningDir)
            {
                learningDocInfo = null;
            }

            //ładuje listę kategorii
            DocumentClass.LoadFromFiles(Settings.Default.pathLearningDir, PreprocessingConsts.CategoryFilePattern);

            //stworzenie słownika
            dictionary = DictionaryFactory(Settings.Default.pathSummaryFile);
            //dictionary.LearningData = new List<DocClass.Src.Learning.LearningPair>();

            //stworzenie sieci
            radialNetwork = new RadialNetwork(Settings.Default.numberNeuronsHidden, DocumentClass.CategoriesCount);

            DocumentList dl = PreprocessingUtility.CreateLearningDocumentList(Settings.Default.pathLearningDir, dictionary, (DocumentRepresentationType)Settings.Default.documentRepresentationType, learningDocInfo);

            if (radialNetwork.Learn(dl) == false)
            {
                radialNetwork = null;
                dictionary    = null;
            }
        }
Exemplo n.º 2
0
        static void Main()
        {
            int classNum         = 20;
            TestDocumentList tdl = new TestDocumentList(100, 100);
            RadialNetwork    rn  = new RadialNetwork(50, classNum);

            for (int i = 0; i < classNum; i++)
            {
                DocumentClass.AddClass(i.ToString());
            }
            rn.Learn(tdl);
        }