Package org.encog.neural.neat

Examples of org.encog.neural.neat.PersistNEATPopulation


    add(new PersistART1());
    add(new PersistBAM());
    add(new PersistBasicNetwork());
    add(new PersistRBFNetwork());
    add(new PersistSOM());
    add(new PersistNEATPopulation());
    add(new PersistNEATNetwork());
    add(new PersistBasicPNN());
    add(new PersistCPN());
    add(new PersistTrainingContinuation());
  }
View Full Code Here


    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());

    // reload initial backup and continue training
    EvolutionaryAlgorithm training2 = NEATUtil.constructNEATTrainer(
      (NEATPopulation)new PersistNEATPopulation().read(new ByteArrayInputStream(serialized1.toByteArray())),
      score);
    training2.iteration();
    // enough training, backup the reloaded population to continue later
    final ByteArrayOutputStream serialized2 = new ByteArrayOutputStream();
    new PersistNEATPopulation().save(serialized2, training2.getPopulation());

    // NEATTraining.init() randomly fails with a NPE in NEATGenome.getCompatibilityScore()
    EvolutionaryAlgorithm training3 = NEATUtil.constructNEATTrainer(
      (NEATPopulation)new PersistNEATPopulation().read(new ByteArrayInputStream(serialized2.toByteArray())),
      score);
    training3.iteration();
    final ByteArrayOutputStream serialized3 = new ByteArrayOutputStream();
    new PersistNEATPopulation().save(serialized3, training3.getPopulation());
  }
View Full Code Here

    // 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();
    new PersistNEATPopulation().save(serialized1, training1.getPopulation());

    final Population population2 = (Population)new PersistNEATPopulation().read(new ByteArrayInputStream(
      serialized1.toByteArray()));
    final ByteArrayOutputStream serialized2 = new ByteArrayOutputStream();
    new PersistNEATPopulation().save(serialized2, population2);
    Assert.assertEquals(serialized1.size(), serialized2.size());   
  }
View Full Code Here

    add(new PersistART1());
    add(new PersistBAM());
    add(new PersistBasicNetwork());
    add(new PersistRBFNetwork());
    add(new PersistSOM());
    add(new PersistNEATPopulation());
    add(new PersistBasicPNN());
    add(new PersistCPN());
    add(new PersistTrainingContinuation());
    add(new PersistBayes());
    add(new PersistHMM());
View Full Code Here

TOP

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

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.