Package com.heatonresearch.aifh.evolutionary.train.basic

Examples of com.heatonresearch.aifh.evolutionary.train.basic.BasicEA.addOperation()


            }
        });

        // Create a shuffle operator.  Use it 1.0 (100%) of the time.
        MutateShuffle opp = new MutateShuffle();
        train.addOperation(1.0, opp);

        // Create a single parent, the genes are set to 1,2,3,4,5.
        IntegerArrayGenome[] parents = new IntegerArrayGenome[1];
        parents[0] = (IntegerArrayGenome) pop.getGenomeFactory().factor();
        for (int i = 1; i <= 5; i++) {
View Full Code Here


            }
        });


        MutatePerturb opp = new MutatePerturb(0.1);
        train.addOperation(1.0, opp);


        // Create a peterb operator.  Use it 1.0 (100%) of the time.
        DoubleArrayGenome[] parents = new DoubleArrayGenome[1];
        parents[0] = (DoubleArrayGenome) pop.getGenomeFactory().factor();
View Full Code Here

            ScoreFunction score = new ScoreRegressionData(trainingData);

            BasicEA genetic = new BasicEA(pop, score);
            genetic.setSpeciation(new ArraySpeciation<DoubleArrayGenome>());
            genetic.setCODEC(codec);
            genetic.addOperation(0.7, new Splice(codec.size() / 5));
            genetic.addOperation(0.3, new MutatePerturb(0.1));


            performIterations(genetic, 100000, 0.05, true);
View Full Code Here

            BasicEA genetic = new BasicEA(pop, score);
            genetic.setSpeciation(new ArraySpeciation<DoubleArrayGenome>());
            genetic.setCODEC(codec);
            genetic.addOperation(0.7, new Splice(codec.size() / 5));
            genetic.addOperation(0.3, new MutatePerturb(0.1));


            performIterations(genetic, 100000, 0.05, true);

            RBFNetwork winner = (RBFNetwork) codec.decode(genetic.getBestGenome());
View Full Code Here

            ScoreFunction score = new ScoreRegressionData(trainingData);

            BasicEA genetic = new BasicEA(pop, score);
            genetic.setCODEC(codec);
            genetic.addOperation(0.7, new Splice(codec.size() / 3));
            genetic.addOperation(0.3, new MutatePerturb(0.1));


            performIterations(genetic, 100000, 0.05, true);
View Full Code Here

            ScoreFunction score = new ScoreRegressionData(trainingData);

            BasicEA genetic = new BasicEA(pop, score);
            genetic.setCODEC(codec);
            genetic.addOperation(0.7, new Splice(codec.size() / 3));
            genetic.addOperation(0.3, new MutatePerturb(0.1));


            performIterations(genetic, 100000, 0.05, true);

            RBFNetwork winner = (RBFNetwork) codec.decode(genetic.getBestGenome());
View Full Code Here

        EvaluateExpression eval = new EvaluateExpression(rnd);
        Population pop = initPopulation(rnd, eval);
        ScoreFunction score = new ScoreSmallExpression(training,30);

        EvolutionaryAlgorithm genetic = new BasicEA(pop, score);
        genetic.addOperation(0.3, new MutateTree(3));
        genetic.addOperation(0.7, new CrossoverTree());
        genetic.setShouldIgnoreExceptions(false);


        int sameSolutionCount = 0;
View Full Code Here

        Population pop = initPopulation(rnd, eval);
        ScoreFunction score = new ScoreSmallExpression(training,30);

        EvolutionaryAlgorithm genetic = new BasicEA(pop, score);
        genetic.addOperation(0.3, new MutateTree(3));
        genetic.addOperation(0.7, new CrossoverTree());
        genetic.setShouldIgnoreExceptions(false);


        int sameSolutionCount = 0;
        int iteration = 1;
View Full Code Here

            }
        });

        // Create a splice operator, length = 5.  Use it 1.0 (100%) of the time.
        Splice opp = new Splice(5);
        train.addOperation(1.0, opp);

        // Create two parents, the genes are set to 1,2,3,4,5,7,8,9,10
        // and 10,9,8,7,6,5,4,3,2,1.
        IntegerArrayGenome[] parents = new IntegerArrayGenome[2];
        parents[0] = (IntegerArrayGenome) pop.getGenomeFactory().factor();
View Full Code Here

            }
        });

        // Create a splice (no repeat) operator, length = 5.  Use it 1.0 (100%) of the time.
        SpliceNoRepeat opp = new SpliceNoRepeat(5);
        train.addOperation(1.0, opp);

        // Create two parents, the genes are set to 1,2,3,4,5,7,8,9,10
        // and 10,9,8,7,6,5,4,3,2,1.
        IntegerArrayGenome[] parents = new IntegerArrayGenome[2];
        parents[0] = (IntegerArrayGenome) pop.getGenomeFactory().factor();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.