Package org.encog.ml.data.basic

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


  }
 
  @Test
  public void testSCG() throws Throwable
  {
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
   
    BasicNetwork network = NetworkUtil.createXORNetworkUntrained();
    MLTrain bprop = new ScaledConjugateGradient(network, trainingData);
    NetworkUtil.testTraining(bprop,0.04);
  }
View Full Code Here


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

  }
 
  @Test
  public void testGenetic() throws Throwable
  {
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);   
    BasicNetwork network = NetworkUtil.createXORNetworkUntrained();
    CalculateScore score = new TrainingSetScore(trainingData);
    NeuralGeneticAlgorithm genetic = new NeuralGeneticAlgorithm(network, new RangeRandomizer(-1,1), score, 500,0.1,0.25);
    NetworkUtil.testTraining(genetic,0.00001);
  }
View Full Code Here

  {
   
    PNNOutputMode mode = PNNOutputMode.Regression;
    BasicPNN network = new BasicPNN(PNNKernelType.Gaussian, mode, 2, 1);

    BasicMLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT,
        XOR.XOR_IDEAL);

    TrainBasicPNN train = new TrainBasicPNN(network, trainingSet);
    train.iteration();
   
View Full Code Here

  {
   
    PNNOutputMode mode = PNNOutputMode.Classification;
    BasicPNN network = new BasicPNN(PNNKernelType.Gaussian, mode, 2, 2);

    BasicMLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT,
        XOR.XOR_IDEAL);

    TrainBasicPNN train = new TrainBasicPNN(network, trainingSet);
    train.iteration();
   
View Full Code Here

    pattern.setInputNeurons(2);
    pattern.setOutputNeurons(1);
    BasicNetwork network = (BasicNetwork)pattern.generate();
   
    // train it
    MLDataSet training = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    MLTrain train = new TrainAdaline(network,training,0.01);
    NetworkUtil.testTraining(train,0.01);
  }
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

      } catch (NumberFormatException e) {
        EncogWorkBench.displayError("Error",
            "Must enter a valid number.");
      }
      TemporalXOR temp = new TemporalXOR();
      BasicMLDataSet trainingData = (BasicMLDataSet) temp
          .generate(count);
      File targetFile = new File(EncogWorkBench.getInstance()
          .getProjectDirectory(), name);
      EncogUtility.saveCSV(targetFile, CSVFormat.ENGLISH, trainingData);
    }
View Full Code Here

TOP

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

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.