Package org.encog.neural.neat

Examples of org.encog.neural.neat.NEATPopulation


          new BasicMLData(XOR.XOR_INPUT[i]),
          new BasicMLData(XOR.XOR_IDEAL[i])));
    }
    buffer.endLoad();
   
    NEATPopulation pop = new NEATPopulation(2,1,1000);
    pop.setInitialConnectionDensity(1.0);// not required, but speeds training
    pop.reset();

    CalculateScore score = new TrainingSetScore(buffer);
    // train the neural network
   
    final EvolutionaryAlgorithm train = NEATUtil.constructNEATTrainer(pop,score);
View Full Code Here


    Assert.assertTrue(network.calculateError(buffer)<0.01);
  }
 
  public void testNEAT() {
    MLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT, XOR.XOR_IDEAL);
    NEATPopulation pop = new NEATPopulation(2,1,1000);
    pop.setInitialConnectionDensity(1.0);// not required, but speeds training
    pop.reset();

    CalculateScore score = new TrainingSetScore(trainingSet);
    // train the neural network
   
    final EvolutionaryAlgorithm train = NEATUtil.constructNEATTrainer(pop,score);
View Full Code Here

  public void testPersistEG()
  {
    Population pop = generate();

    EncogDirectoryPersistence.saveObject((EG_FILENAME), pop);
    NEATPopulation pop2 = (NEATPopulation)EncogDirectoryPersistence.loadObject((EG_FILENAME));
   
    validate(pop2);
  }
View Full Code Here

    validate(pop2);
  }
 
  public void testPersistSerial() throws IOException, ClassNotFoundException
  {
    NEATPopulation pop = generate();
    validate(pop);
   
    SerializeObject.save(SERIAL_FILENAME, pop);
    NEATPopulation pop2 = (NEATPopulation)SerializeObject.load(SERIAL_FILENAME);
   
    validate(pop2);
  }
View Full Code Here

  public void testNPE() throws Exception
  {
    final CalculateScore score = new TrainingSetScore(new BasicMLDataSet(FAKE_DATA, FAKE_DATA));

    // create a new random population and train it
    NEATPopulation pop = new NEATPopulation(FAKE_DATA[0].length, 1, 50);
    pop.reset();
    EvolutionaryAlgorithm training1 = NEATUtil.constructNEATTrainer(pop, score);
    training1.iteration();
    // enough training for now, backup current population to continue later
    final ByteArrayOutputStream serialized1 = new ByteArrayOutputStream();
    new PersistNEATPopulation().save(serialized1, training1.getPopulation());
View Full Code Here

  }

  public void testSaveRead() throws Exception
  {
    final CalculateScore score = new TrainingSetScore(new BasicMLDataSet(FAKE_DATA, FAKE_DATA));
    NEATPopulation pop = new NEATPopulation(FAKE_DATA[0].length, 1, 50);
    pop.reset();
    // create a new random population and train it
    EvolutionaryAlgorithm training1 = NEATUtil.constructNEATTrainer(pop, score);
    training1.iteration();
    // enough training for now, backup current population
    final ByteArrayOutputStream serialized1 = new ByteArrayOutputStream();
View Full Code Here

 
  @Test
  public void testSort1() {
   
    MLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    NEATPopulation pop = new NEATPopulation(2,1,100);
    pop.reset();
    CalculateScore score = new TrainingSetScore(trainingSet);
    final EvolutionaryAlgorithm train = NEATUtil.constructNEATTrainer(pop,score);
       
    NEATGenome genome1 = new NEATGenome();
    genome1.setAdjustedScore(3.0);
View Full Code Here

 
  @Test
  public void testSort2() {
   
    MLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    NEATPopulation pop = new NEATPopulation(2,1,100);
    pop.reset();
    CalculateScore score = new TrainingSetScore(trainingSet);
    final EvolutionaryAlgorithm train = NEATUtil.constructNEATTrainer(pop,score);
       
    NEATGenome genome1 = new NEATGenome();
    genome1.setAdjustedScore(3.0);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public MLMethod decode(final Genome genome) {
    final NEATPopulation pop = (NEATPopulation) genome.getPopulation();
    final Substrate substrate = pop.getSubstrate();
    return decode(pop, substrate, genome);
  }
View Full Code Here

TOP

Related Classes of org.encog.neural.neat.NEATPopulation

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.