Package org.encog.ml.data.basic

Examples of org.encog.ml.data.basic.BasicMLDataSet


    Assert.assertTrue(train.getError()<0.01);
    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);
View Full Code Here


      return true;
    }
   
    public static MLDataSet createXORDataSet()
    {
      return new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    }
View Full Code Here

      network.reset();
      return network;
    }

    public static MLDataSet createNoisyXORDataSet(int count) {
      MLDataSet result = new BasicMLDataSet();
      for(int i=0;i<count;i++) {
        for(int j=0;j<4;j++) {
          MLData inputData = new BasicMLData(XOR_INPUT[j]);
          MLData idealData = new BasicMLData(XOR_IDEAL[j]);
          MLDataPair pair = new BasicMLDataPair(inputData,idealData);
          inputData.setData(0, inputData.getData(0)+RangeRandomizer.randomize(-0.1, 0.1));
          inputData.setData(1, inputData.getData(1)+RangeRandomizer.randomize(-0.1, 0.1));
          result.add(pair);
        }
      }
      return result;
    }
View Full Code Here

public class TestLimited extends TestCase {
 
  public void testLimited()
  {
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    BasicNetwork network = NetworkUtil.createXORNetworkUntrained();   
   
    ResilientPropagation rprop = new ResilientPropagation(network,trainingData);
    rprop.iteration();
    rprop.iteration();
View Full Code Here

public class TestFreeformTraining extends TestCase {
 
  @Test
  public void testBPROP() throws Throwable
  {
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
   
    FreeformNetwork network = NetworkUtil.createXORFreeformNetworkUntrained();

    MLTrain bprop = new FreeformBackPropagation(network, trainingData, 0.7, 0.9);
    NetworkUtil.testTraining(trainingData,bprop,0.01);
View Full Code Here

  }
 
  @Test
  public void testRPROP() throws Throwable
  {
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
   
    FreeformNetwork network = NetworkUtil.createXORFreeformNetworkUntrained();

    MLTrain bprop = new FreeformResilientPropagation(network, trainingData);
    NetworkUtil.testTraining(trainingData,bprop,0.01);
View Full Code Here

  }
 
  @Test
  public void testAnneal() throws Throwable
  {
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);   
    FreeformNetwork network = NetworkUtil.createXORFreeformNetworkUntrained();
    CalculateScore score = new TrainingSetScore(trainingData);
    NeuralSimulatedAnnealing anneal = new NeuralSimulatedAnnealing(network,score,10,2,100);
    NetworkUtil.testTraining(trainingData,anneal,0.01);
  }
View Full Code Here

  }
 
  @Test
  public void testGenetic() throws Throwable
  {
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);   
    CalculateScore score = new TrainingSetScore(trainingData);
    MLMethodGeneticAlgorithm genetic = new MLMethodGeneticAlgorithm(new MethodFactory(){
      @Override
      public MLMethod factor() {
        FreeformNetwork network = NetworkUtil.createXORFreeformNetworkUntrained();
View Full Code Here

  }
 
  public void testEncode() {
   
    // train (and test) a network
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);   
    FreeformNetwork trainedNetwork = NetworkUtil.createXORFreeformNetworkUntrained();
    MLTrain bprop = new FreeformResilientPropagation(trainedNetwork, trainingData);
    NetworkUtil.testTraining(trainingData,bprop,0.01);
   
    trainedNetwork = (FreeformNetwork) bprop.getMethod();
View Full Code Here

public class TestTrainingContinuation extends TestCase {
  public void testContRPROP()
  {
    BasicNetwork network1 = NetworkUtil.createXORNetworkUntrained();
    BasicNetwork network2 = NetworkUtil.createXORNetworkUntrained();
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
   
    // train network 1, no continue
    ResilientPropagation rprop1 = new ResilientPropagation(network1,trainingData);
    rprop1.iteration();
    rprop1.iteration();
View Full Code Here

TOP

Related Classes of org.encog.ml.data.basic.BasicMLDataSet

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.