Examples of MersenneTwisterGenerateRandom


Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom

        // Get the training and cross validation sets.
        List<BasicData> training = fold.getTrainingSet();
        List<BasicData> validation = fold.getValidationSet();

        // Create random particles for the RBF.
        GenerateRandom rnd = new MersenneTwisterGenerateRandom();
        RBFNetwork[] particles = new RBFNetwork[TitanicConfig.ParticleCount];
        for (int i = 0; i < particles.length; i++) {
            particles[i] = new RBFNetwork(TitanicConfig.InputFeatureCount, TitanicConfig.RBF_COUNT, 1);
            particles[i].reset(rnd);
        }
View Full Code Here

Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom

     */
    public void process(File dataPath) {
        File trainingPath = new File(dataPath, TitanicConfig.TrainingFilename);
        File testPath = new File(dataPath, TitanicConfig.TestFilename);

        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        try {

            // Generate stats on the titanic.
            TitanicStats stats = new TitanicStats();
View Full Code Here

Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom

            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

Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom

     */
    public static void splice() {
        System.out.println("Crossover Splice");

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

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

View Full Code Here

Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom

     */
    public static void spliceNoRepeat() {
        System.out.println("Crossover Splice No Repeat");

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

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

View Full Code Here

Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom

    /**
     * Perform a reset.
     */
    public void performReset() {
        boolean[][] grid = this.worldArea.getBackupGrid();
        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        for (int row = 0; row < this.worldArea.getRows(); row++) {
            for (int col = 0; col < this.worldArea.getCols(); col++) {
                grid[row][col] = rnd.nextBoolean();
            }
        }

        this.worldArea.advanceBackupGrid();

View Full Code Here

Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom

            genome.setScore(i);
            genome.setAdjustedScore(i);
            pop.getSpecies().get(0).add(genome);
        }

        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        // Create a trainer with a very simple score function.  We do not care
        // about the calculation of the score, as they will never be calculated.
        // We only care that we are maximizing.
        EvolutionaryAlgorithm train = new BasicEA(pop, new ScoreFunction() {
View Full Code Here

Examples of org.encog.mathutil.randomize.generate.MersenneTwisterGenerateRandom

  /**
   * Construct a random number generator with a random(current time) seed. If
   * you want to set your own seed, just call "getRandom().setSeed".
   */
  public BasicRandomizer() {
    this.random = new MersenneTwisterGenerateRandom(System.nanoTime());
  }
View Full Code Here

Examples of org.encog.mathutil.randomize.generate.MersenneTwisterGenerateRandom

      int seed) {
    List<DataDivision> dataDivisionList = new ArrayList<DataDivision>();
    dataDivisionList.add(new DataDivision(1.0 - validationPercent));// Training
    dataDivisionList.add(new DataDivision(validationPercent));// Validation
    this.dataset.divide(dataDivisionList, shuffle,
        new MersenneTwisterGenerateRandom(seed));
    this.trainingDataset = dataDivisionList.get(0).getDataset();
    this.validationDataset = dataDivisionList.get(1).getDataset();
  }
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.