Package com.heatonresearch.aifh.randomize

Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom


     */
    public static void mutateShuffle() {
        System.out.println("Mutate shuffle");

        // Create a random number generator
        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        // Create a new population.
        Population pop = new BasicPopulation();
        pop.setGenomeFactory(new IntegerArrayGenomeFactory(5));

View Full Code Here


     * gene.
     */
    public static void mutatePeterb() {
        System.out.println("Mutate Perturb");

        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        // Create a new population.
        Population pop = new BasicPopulation();
        pop.setGenomeFactory(new DoubleArrayGenomeFactory(5));

View Full Code Here

            final InputStream istream = this.getClass().getResourceAsStream("/iris.csv");
            if (istream == null) {
                System.out.println("Cannot access data set, make sure the resources are available.");
                System.exit(1);
            }
            GenerateRandom rnd = new MersenneTwisterGenerateRandom();

            final DataSet ds = DataSet.load(istream);
            // The following ranges are setup for the Iris data set.  If you wish to normalize other files you will
            // need to modify the below function calls other files.
            ds.normalizeRange(0, -1, 1);
View Full Code Here

            final InputStream istream = this.getClass().getResourceAsStream("/iris.csv");
            if (istream == null) {
                System.out.println("Cannot access data set, make sure the resources are available.");
                System.exit(1);
            }
            GenerateRandom rnd = new MersenneTwisterGenerateRandom();

            final DataSet ds = DataSet.load(istream);
            // The following ranges are setup for the Iris data set.  If you wish to normalize other files you will
            // need to modify the below function calls other files.
            ds.normalizeRange(0, -1, 1);
View Full Code Here

        final DataSet ds = DataSet.load(istream);
        // Extract supervised training.
        List<BasicData> training = ds.extractSupervised(0, 1, 1, 1);


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

        EvolutionaryAlgorithm genetic = new BasicEA(pop, score);
View Full Code Here

            istream.close();

            final List<BasicData> trainingData = ds.extractSupervised(0, 4, 4, 2);

            final RBFNetwork network = new RBFNetwork(4, 4, 2);
            network.reset(new MersenneTwisterGenerateRandom());
            final ScoreFunction score = new ScoreRegressionData(trainingData);
            final TrainNelderMead train = new TrainNelderMead(network, score);
            performIterations(train, 1000, 0.01, true);
            queryEquilateral(network, trainingData, species, 0, 1);
View Full Code Here

            istream.close();

            final List<BasicData> trainingData = ds.extractSupervised(0, 4, 4, 2);

            final RBFNetwork network = new RBFNetwork(4, 4, 2);
            network.reset(new MersenneTwisterGenerateRandom());
            final ScoreFunction score = new ScoreRegressionData(trainingData);
            final TrainHillClimb train = new TrainHillClimb(true, network, score);
            performIterations(train, 100000, 0.01, true);
            queryEquilateral(network, trainingData, species, 0, 1);
View Full Code Here

            istream.close();

            final List<BasicData> trainingData = ds.extractSupervised(0, 4, 4, 3);

            final RBFNetwork network = new RBFNetwork(4, 4, 3);
            network.reset(new MersenneTwisterGenerateRandom());

            final ScoreFunction score = new ScoreRegressionData(trainingData);
            final TrainAnneal train = new TrainAnneal(network, score);
            performIterations(train, 100000, 0.01, true);
            queryOneOfN(network, trainingData, species);
View Full Code Here

     * @param high    The high value.
     * @param distort The distortion factor.
     * @return The data set.
     */
    public DataHolder generate(final int seed, final int rows, final int cols, final double low, final double high, final double distort) {
        final GenerateRandom rnd = new MersenneTwisterGenerateRandom(seed);

        final double[][] ideal = new double[rows][cols];
        final double[][] actual = new double[rows][cols];

        for (int row = 0; row < rows; row++) {
            for (int col = 0; col < cols; col++) {
                ideal[row][col] = rnd.nextDouble(low, high);
                actual[row][col] = ideal[row][col] + (rnd.nextGaussian() * distort);
            }
        }

        final DataHolder result = new DataHolder();
        result.setActual(actual);
View Full Code Here

     */
    public ContinuousACO(final MLMethod theAlgorithm, final ScoreFunction theScore, final int thePopulationSize) {
        this.algorithm = theAlgorithm;
        this.populationSize = thePopulationSize;
        this.score = theScore;
        this.random = new MersenneTwisterGenerateRandom();
        this.paramCount = theAlgorithm.getLongTermMemory().length;

        this.population = new ContinuousAnt[thePopulationSize * 2];
        this.weighting = new double[thePopulationSize];
        for (int i = 0; i < this.population.length; i++) {
View Full Code Here

TOP

Related Classes of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom

Copyright © 2018 www.massapicom. 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.