Package org.encog.ml.data.basic

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


        "CPU result: " + result);
    this.cpuScore = result;
  }

  private void evalMemory() {
    final BasicMLDataSet training = RandomTrainingFactory.generate(
        1000, 10000, 10, 10, -1, 1);

    final long start = System.currentTimeMillis();
    final long stop = start + (10 * Evaluate.MILIS);
    int record = 0;

    MLDataPair pair = BasicMLDataPair.createPair(10, 10);

    int iterations = 0;
    while (System.currentTimeMillis() < stop) {
      iterations++;
      training.getRecord(record++, pair);
      if (record >= training.getRecordCount())
        record = 0;
    }

    iterations /= 100000;

View Full Code Here


  }

  private void evalBinary() {
    File file = new File("temp.egb");

    final BasicMLDataSet training = RandomTrainingFactory.generate(
        1000, 10000, 10, 10, -1, 1);

    // create the binary file

    file.delete();
    BufferedNeuralDataSet training2 = new BufferedNeuralDataSet(file);
    training2.load(training);

    final long start = System.currentTimeMillis();
    final long stop = start + (10 * Evaluate.MILIS);
    int record = 0;

    MLDataPair pair = BasicMLDataPair.createPair(10, 10);

    int iterations = 0;
    while (System.currentTimeMillis() < stop) {
      iterations++;
      training2.getRecord(record++, pair);
      if (record >= training2.getRecordCount())
        record = 0;
    }

    training.close();
    iterations /= 100000;

    this.report.report(EncogBenchmark.STEPS, EncogBenchmark.STEP4,
        "Disk(binary) dataset, result: "
            + Format.formatInteger(iterations));
View Full Code Here

   * Load the binary dataset to memory. Memory access is faster.
   *
   * @return A memory dataset.
   */
  public final MLDataSet loadToMemory() {
    BasicMLDataSet result = new BasicMLDataSet();

    for (MLDataPair pair : this) {
      result.add(pair);
    }

    return result;
  }
View Full Code Here

   */
  public final MLDataSet external2Memory() {
    this.status.report(0, 0, "Importing to memory");

    if (this.result == null) {
      this.result = new BasicMLDataSet();
    }

    final double[] input = new double[this.codec.getInputSize()];
    final double[] ideal = new double[this.codec.getIdealSize()];
    final double[] significance = new double[1];
View Full Code Here

    return network.getStructure().getFlat().clone();
  }

  public static void main(String[] args) {
   
    MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);

    FlatNetwork network = createNetwork();

    System.out.println("Starting Weights:");
    displayWeights(network);
View Full Code Here

  public static void main(final String args[]) {
   
    FlatNetwork network = new FlatNetwork(2,4,0,1,false);
    network.randomize();
   
    MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
   
   
    TrainFlatNetworkResilient train = new TrainFlatNetworkResilient(network,trainingSet);
   
    //Encog.getInstance().initCL();
View Full Code Here

    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,1));
    network.getStructure().finalizeStructure();
    network.reset();

    // create training data
    MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
   
    // train the neural network
    final ResilientPropagation train = new ResilientPropagation(network, trainingSet);

    int epoch = 1;
View Full Code Here

    NguyenWidrowRandomizer nwrRandom = new NguyenWidrowRandomizer(-1, 1);
    FanInRandomizer fanRandom = new FanInRandomizer();
    GaussianRandomizer gaussianRandom = new GaussianRandomizer(0, 1);

    System.out.println("Error improvement, higher is better.");
    BasicMLDataSet training = new BasicMLDataSet(XOR_INPUT,
        XOR_IDEAL);
    BasicNetwork network = EncogUtility.simpleFeedForward(2, 10, 0, 1, true);

    System.out.println("Range random: "
        + evaluateRandomizer(rangeRandom, network, training));
View Full Code Here

    { 1.0, 1.0, -1.0, -1.0 } };
 
  public static void main(String args[])
  { 
    // create the training set
    MLDataSet training = new BasicMLDataSet(SOM_INPUT,null);
   
    // Create the neural network.
    SOM network = new SOM(4,2);
    network.reset();
   
View Full Code Here

    } while(train.getError()>0.01);
  }
 
  public MLDataSet generateTraining(double[][] input,double[][] ideal)
  {
    MLDataSet result = new BasicMLDataSet(input,ideal);
    return result;
  }
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.