Beispiel #1
0
        void KohonenTeach()
        {
            Neuron.RandRange = new Range(0.0f, 1.0f);
            kohonenNetwork = new DistanceNetwork(liczba_wejsc, liczba_neuronow_pion * liczba_neuronow_poziom);
            kohonenNetwork.Randomize();
            SOMLearning teacher = new SOMLearning(kohonenNetwork);

            double driftingLearningRate = this.wps_zmiany_wsp;
            double fixedLearningRate = this.pocz_wart_wsp_nauki;
            double learningRadius = this.pocz_rozmiar_sasiedz;
            double driftingLearningRadius = this.wsp_zmian_rozm_sasiedz;
            int iteration = 1;
            while (!needToStop)
            {
                teacher.LearningRate = driftingLearningRate * (numberOfCycles - iteration) / numberOfCycles + fixedLearningRate;
                teacher.LearningRadius = (double)learningRadius * (numberOfCycles - iteration) / numberOfCycles;

                teacher.RunEpoch(trainingKData);

                SetIterationsCount(iteration++);
                if (iteration > numberOfCycles) break;
            }
            teachingDone = true;
            needToStop = false;
            UpdateLabels();
        }