Beispiel #1
0
        public override void PostProcessing()
        {
            NNClassificationQualityEvaluator evaluator = this._problem.SolutionQualityEvaluator as NNClassificationQualityEvaluator;
            //NeuralNetwork network = evaluator.NeuralNetwork;
            NeuralNetwork network = evaluator.CreateNeuralNetwork(this._bestAnt.Solution);

            this.NetworkBeforePostProcessing = network;

            //this.PerformLocalSearch(this._bestAnt);
            NeuralNetworks.LearningMethods.BackPropagation BP = new NeuralNetworks.LearningMethods.BackPropagation(0.01, 1000, 0.9, true);
            this.FinalNetwork = evaluator.CreateNeuralNetwork(this._bestAnt.Solution, BP);
        }
Beispiel #2
0
        public void PostProcessing2()
        {
            NNClassificationQualityEvaluator evaluator = this._problem.SolutionQualityEvaluator as NNClassificationQualityEvaluator;
            //NeuralNetwork network = evaluator.NeuralNetwork;
            NeuralNetwork network = evaluator.CreateNeuralNetwork(this._bestAnt.Solution);

            this.NetworkBeforePostProcessing = network;

            //this.PerformLocalSearch(this._bestAnt);
            int    maxIterations = 1000;
            int    colonySize    = 1;
            int    convergence   = 100;
            int    archive       = 25;
            double q             = 0.25;
            double segma         = 0.85;
            int    problemSize   = network.Size;

            NNClassificationQualityEvaluator2 evaluator2 = new NNClassificationQualityEvaluator2(-5, 5, evaluator.Measure);

            evaluator2.LearningSet   = _trainingSet;
            evaluator2.ValidationSet = _trainingSet;
            evaluator2.NeuralNetwork = network;

            Problem <double> problem = new Problem <double>(null, null, evaluator2, null);

            ACO_RNN acornn = new ACO_RNN(maxIterations, colonySize, convergence, problem, problemSize, archive, q, segma);

            acornn.OnPostColonyIteration += OnPostColonyIteration;

            acornn.TrainNetwork(network, _trainingSet);
            this.FinalNetwork = network;
        }