Package org.encog.ml.data

Examples of org.encog.ml.data.MLDataSet


      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

      int input = dialog.getColumns().getValue();

      File targetFile = new File(EncogWorkBench.getInstance()
          .getProjectDirectory(), name);

      MLDataSet trainingData = RandomTrainingFactory.generate(
          System.currentTimeMillis(), elements, input, 0, low, high);

      EncogUtility.saveCSV(targetFile, CSVFormat.ENGLISH, trainingData);
    }
  }
View Full Code Here

      ProjectEGFile popFile = dialog.getPopulation();
      NEATPopulation pop = (NEATPopulation) popFile.getObject();

      pop.setInputCount(2);
      pop.setOutputCount(1);
      MLDataSet training = dialog.getTrainingSet();

      if (dialog.getLoadToMemory().getValue()) {
        training = ((BufferedNeuralDataSet) training).loadToMemory();
      }
View Full Code Here

    if (mlMethod != null)
      dialog.setMethod(mlMethod);

    if (dialog.process()) {
      MLMethod method = dialog.getNetwork();
      MLDataSet trainingData = dialog.getTrainingSet();

      if (method == null) {
        EncogWorkBench.displayError("Error",
            "Machine language method is required to train.");
        return;
View Full Code Here

    network.addLayer(new BasicLayer(new ActivationSigmoidPosNeg(), true, 4));
    network.addLayer(new BasicLayer(new ActivationSigmoidPosNeg(), true, 1));
    network.getStructure().finalizeStructure();
    network.reset();

    final MLDataSet trainingSet = new BasicMLDataSet(
        CustomActivation.XOR_INPUT, CustomActivation.XOR_IDEAL);

   
    // train the neural network
    final MLTrain train = new ResilientPropagation(network, trainingSet);
View Full Code Here

    dialog.getWeightTries().setValue(5);
    dialog.getIterations().setValue(25);
    dialog.getWindowSize().setValue(10);

    if (dialog.process()) {
      MLDataSet training = dialog.getTraining();     
     
      if( training == null ) {
        return null;
      }
     
     
      FeedForwardPattern pattern = new FeedForwardPattern();
      pattern.setInputNeurons(training.getInputSize());
      pattern.setOutputNeurons(training.getIdealSize());
   
     
      pattern.setActivationFunction(dialog.getActivationFunction());     
      IncrementalPruneTab tab = new IncrementalPruneTab(
          dialog.getIterations().getValue(),
View Full Code Here

public class TestFolded extends TestCase {
  @Test
  public void testRPROP() throws Throwable
  {
    MLDataSet trainingData = XOR.createNoisyXORDataSet(10);
   
    BasicNetwork network = NetworkUtil.createXORNetworkUntrained();
   
    final FoldedDataSet folded = new FoldedDataSet(trainingData);
    final MLTrain train = new ResilientPropagation(network, folded);
View Full Code Here

*/
public class XORCSV {

  public static void main(final String args[]) {

    final MLDataSet trainingSet = TrainingSetUtil.loadCSVTOMemory(
        CSVFormat.ENGLISH, "c:\\temp\\xor.csv", false, 2, 1);
    final BasicNetwork network = EncogUtility.simpleFeedForward(2, 4, 0, 1,
        true);

    System.out.println();
View Full Code Here

 
  @Test
  public void testSOM() {

    // create the training set
    final MLDataSet training = new BasicMLDataSet(
        TestCompetitive.SOM_INPUT, null);

    // Create the neural network.
    SOM network = new SOM(4,2);   
    network.setWeights(new Matrix(MATRIX_ARRAY));
View Full Code Here

TOP

Related Classes of org.encog.ml.data.MLDataSet

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.