Examples of MLDataSet


Examples of org.encog.ml.data.MLDataSet

  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
 
  private NEATPopulation generate()
  {
    MLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT, XOR.XOR_IDEAL);
   
    CalculateScore score = new TrainingSetScore(trainingSet);
    // train the neural network
    ActivationStep step = new ActivationStep();
    step.setCenter(0.5);
View Full Code Here

Examples of org.encog.ml.data.MLDataSet

    Assert.assertEquals(0.2,pop.getSurvivalRate());
    Assert.assertEquals(10,pop.getYoungBonusAgeThreshold());
    Assert.assertEquals(0.3,pop.getYoungScoreBonus());
   
    // see if the population can actually be used to train
    MLDataSet trainingSet = new BasicMLDataSet(XOR.XOR_INPUT, XOR.XOR_IDEAL);   
    CalculateScore score = new TrainingSetScore(trainingSet);
    NEATTraining train = new NEATTraining(score,pop);
    train.iteration();

  }
View Full Code Here

Examples of org.encog.ml.data.MLDataSet

  public final TempDir TEMP_DIR = new TempDir();
  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");

  public void testRPROPCont() {
    MLDataSet trainingSet = XOR.createXORDataSet();
    BasicNetwork net1 = XOR.createUnTrainedXOR();
    BasicNetwork net2 = XOR.createUnTrainedXOR();
   
    ResilientPropagation rprop1 = new ResilientPropagation(net1,trainingSet);
    ResilientPropagation rprop2 = new ResilientPropagation(net2,trainingSet);
View Full Code Here

Examples of org.encog.ml.data.MLDataSet

      Assert.assertEquals(net1.getFlat().getWeights()[i], net2.getFlat().getWeights()[i],0.0001);
    }
  }
 
  public void testRPROPContPersistEG() {
    MLDataSet trainingSet = XOR.createXORDataSet();
    BasicNetwork net1 = XOR.createUnTrainedXOR();
    BasicNetwork net2 = XOR.createUnTrainedXOR();
   
    ResilientPropagation rprop1 = new ResilientPropagation(net1,trainingSet);
    ResilientPropagation rprop2 = new ResilientPropagation(net2,trainingSet);
View Full Code Here

Examples of org.encog.ml.data.MLDataSet

  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
 
  public void testPersistNetworkRBF()
  {
    MLDataSet trainingSet = XOR.createXORDataSet();
    RBFNetwork network = new RBFNetwork(2,4,1, RBFEnum.Gaussian);

    SVDTraining training = new SVDTraining(network,trainingSet);
    training.iteration();
    XOR.verifyXOR(network, 0.1);
View Full Code Here

Examples of org.encog.ml.data.MLDataSet

        Assert.assertEquals(37, (int)kmeans.getWCSS());
                             
        int i = 1;
        for(MLCluster cluster: kmeans.getClusters())
        {
          MLDataSet ds = cluster.createDataSet();
            MLDataPair pair = BasicMLDataPair.createPair(ds.getInputSize(), ds.getIdealSize());
            for(int j=0;j<ds.getRecordCount();j++)
            {
              ds.getRecord(j, pair);
              for(j=0;j<pair.getInputArray().length;j++) {
                if(i==1) {
                  Assert.assertTrue(pair.getInputArray()[j]>10);
                } else {
                  Assert.assertTrue(pair.getInputArray()[j]<10);
View Full Code Here

Examples of org.encog.ml.data.MLDataSet

  public final File EG_FILENAME = TEMP_DIR.createFile("encogtest.eg");
  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
 
  private SVM create()
  {
    MLDataSet training = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    SVM result = new SVM(2,SVMType.EpsilonSupportVectorRegression,KernelType.RadialBasisFunction);
    final SVMTrain train = new SVMTrain(result, training);
    train.iteration();
    return result;
  }
View Full Code Here

Examples of org.encog.ml.data.MLDataSet

    generateTraining();
   
    BasicNetwork ffNetwork = createFeedForward()
    BasicNetwork jordanNetwork = createJordan();
   
    MLDataSet trainingSet = new BasicMLDataSet(this.input, this.ideal);
   
    // train the neural network
    EncogUtility.trainConsole( jordanNetwork, trainingSet, 1);
    EncogUtility.trainConsole( ffNetwork, trainingSet, 1);
   
View Full Code Here

Examples of org.encog.ml.data.MLDataSet

  public static void main(final String args[]) {
   
    ErrorCalculation.setMode(ErrorCalculationMode.RMS);
   
    final TemporalXOR temp = new TemporalXOR();
    final MLDataSet trainingSet = temp.generate(120);

    final BasicNetwork jordanNetwork = JordanXOR.createJordanNetwork();
    final BasicNetwork feedforwardNetwork = JordanXOR
        .createFeedforwardNetwork();
View Full Code Here

Examples of org.encog.ml.data.MLDataSet

   * Process the array.
   * @param data The array to process.
   * @return A neural data set that contains the time-series.
   */
  public final MLDataSet process(final double[] data) {
    final MLDataSet result = new BasicMLDataSet();

    final int totalWindowSize = this.inputWindow + this.predictWindow;
    final int stopPoint = data.length - totalWindowSize;

    for (int i = 0; i < stopPoint; i++) {
      final MLData inputData
        = new BasicMLData(this.inputWindow);
      final MLData idealData
        = new BasicMLData(this.predictWindow);

      int index = i;

      // handle input window
      for (int j = 0; j < this.inputWindow; j++) {
        inputData.setData(j, data[index++]);
      }

      // handle predict window
      for (int j = 0; j < this.predictWindow; j++) {
        idealData.setData(j, data[index++]);
      }

      final MLDataPair pair = new BasicMLDataPair(inputData,
          idealData);
      result.add(pair);
    }

    return result;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.