Package org.encog.neural.neat

Examples of org.encog.neural.neat.NEATNetwork


    link(0.01, input2, hidden1, false);
    link(0.01, bias, hidden1, false);
    link(0.01, hidden1, output, false);
   
    // create the network
    NEATNetwork result = new NEATNetwork(2,
        1,
        neurons,
        afSigmoid,
        afStep,
        3);
View Full Code Here


    to.getInboundLinks().add(l);
  }
 
  public void testPersistEG()
  {
    NEATNetwork network = create();

    EncogDirectoryPersistence.saveObject((EG_FILENAME), network);
    NEATNetwork network2 = (NEATNetwork)EncogDirectoryPersistence.loadObject((EG_FILENAME));
   
    validate(network2);
  }
View Full Code Here

    validate(network2);
  }
 
  public void testPersistSerial() throws IOException, ClassNotFoundException
  {
    NEATNetwork network = create();
   
    SerializeObject.save(SERIAL_FILENAME, network);
    NEATNetwork network2 = (NEATNetwork)SerializeObject.load(SERIAL_FILENAME);
       
    validate(network2);
  }
View Full Code Here

        toNeuron.getInboundLinks().add(link);

      }
    }

    NEATNetwork network = new NEATNetwork(inputCount,
        outputCount,
        neurons,
        pop.getNeatActivationFunction(),
        pop.getOutputActivationFunction(),
        0);
   
   
    network.setSnapshot(pop.isSnapshot());   
    setOrganism(network);   
  }
View Full Code Here

   
    final NEATTraining train = new NEATTraining(score,pop);
   
    EncogUtility.trainToError(train, 0.01);

    NEATNetwork network = (NEATNetwork)train.getMethod();

    network.clearContext();
    // test the neural network
    System.out.println("Neural Network Results:");
    EncogUtility.evaluate(network, trainingSet);
  }
View Full Code Here

     
      for(int i=0;i<count;i++)
      {
        Genome genome = this.population.getGenomes().get(i);
        genome.decode();
        NEATNetwork network = (NEATNetwork)genome.getOrganism();
        String name = FileUtil.forceExtension( prefix + i, "eg" );
        File path = new File(EncogWorkBench.getInstance().getProjectDirectory(),name);
        EncogWorkBench.getInstance().save(path, network);
       
      }
View Full Code Here

   
    if( method instanceof BasicNetwork ) {
      BasicNetwork network = (BasicNetwork)method;
      g = buildGraph(network.getStructure().getFlat());
    } else if( method instanceof NEATNetwork ) {
      NEATNetwork neat = (NEATNetwork)method;
      g = buildGraph(neat);
    }
   
    if( g==null ) {
      throw new WorkBenchError("Can't visualize network: " + method.getClass().getSimpleName());
View Full Code Here

    report.tablePair("Context",
        (method instanceof MLContext) ? "true" : "false");
   
   
    if( method instanceof NEATNetwork ) {
      NEATNetwork neat = (NEATNetwork)method;
      report.tablePair("Output Activation Function", neat.getOutputActivationFunction().getClass().getSimpleName());
      report.tablePair("NEAT Activation Function", neat.getActivationFunction().getClass().getSimpleName());
    }
   
    if( method instanceof CPN ) {
      CPN cpn = (CPN)method;
      report.tablePair("Instar Count", Format.formatInteger(cpn.getInstarCount()));
View Full Code Here

    do {
      train.iteration();
      System.out.println("Epoch #" + train.getIteration() + " Error:" + train.getError()+ ", Species:" + pop.getSpecies().size());
    } while(train.getError() > 0.01);

    NEATNetwork network = (NEATNetwork)train.getCODEC().decode(train.getBestGenome());

    // test the neural network
    System.out.println("Neural Network Results:");
    EncogUtility.evaluate(network, trainingSet);
   
View Full Code Here

    } while(train.getError() > 0.01);

    // test the neural network
    Encog.getInstance().shutdown();
    Assert.assertTrue(train.getError()<0.01);
    NEATNetwork network = (NEATNetwork)train.getCODEC().decode(train.getBestGenome());
    Assert.assertTrue(network.calculateError(trainingSet)<0.01);
  }
View Full Code Here

TOP

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

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.