Package org.encog.ml.data.basic

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


    if (getOutputFormat() == null) {
      setOutputFormat(this.getInputFormat());
    }

    this.data = new BasicMLDataSet();
    resetStatus();
    int recordCount = 0;

    final int outputLength = this.analyst.determineUniqueColumns();
    final ReadCSV csv = new ReadCSV(this.getInputFilename().toString(),
View Full Code Here


          % TemporalXOR.SEQUENCE.length];
      this.ideal[i][0] = TemporalXOR.SEQUENCE[(i + 1)
          % TemporalXOR.SEQUENCE.length];
    }

    return new BasicMLDataSet(this.input, this.ideal);
  }
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

 
  @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

  public static long benchmarkEncogFlat(double[][] input, double[][] output) {
    FlatNetwork network = new FlatNetwork(input[0].length, HIDDEN_COUNT, 0,
        output[0].length, false);
    network.randomize();
    BasicMLDataSet trainingSet = new BasicMLDataSet(input, output);

    TrainFlatNetworkBackPropagation train = new TrainFlatNetworkBackPropagation(
        network, trainingSet, 0.7, 0.7);

    double[] a = new double[2];
View Full Code Here

    network.getStructure().finalizeStructure();
    network.reset();
    new ConsistentRandomizer(-1,1).randomize(network);

    // create training data
    MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
    final MLTrain train = new ResilientPropagation(network, trainingSet);
    //
    int epoch = 1;
    do {
      train.iteration();
View Full Code Here

  public static double XOR_IDEAL[][] = { { 0.0 }, { 1.0 }, { 1.0 }, { 0.0 } };

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

    MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, 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

        }else{
            neuralNetwork=(BasicNetwork)EncogDirectoryPersistence.loadObject(file);
        }
    }
    private Object getNeuralNetworkTrainingData(NeuralData nd){
        MLDataSet trainingSet=new BasicMLDataSet();
       
        MLData mdInput=new BasicMLData(nd.getInputVector());
        MLData mdOuput=new BasicMLData(nd.getOutputVector());
       
               
        trainingSet.add(mdInput, mdOuput);
       
        return trainingSet;
    }
View Full Code Here

       
        return trainingSet;
    }
   
    private Object getNeuralNetworkTrainingData(NeuralData [] ndArray){
        MLDataSet trainingSet=new BasicMLDataSet();
       
        for(int i=0;i<ndArray.length;i++){
            MLData mdInput=new BasicMLData(ndArray[i].getInputVector());
            MLData mdOuput=new BasicMLData(ndArray[i].getOutputVector());
   
            trainingSet.add(mdInput, mdOuput);
        }
        return trainingSet;
    }
View Full Code Here

   * Create a dataset from the clustered data.
   * @return The dataset.
   */
  @Override
  public final MLDataSet createDataSet() {
    final MLDataSet result = new BasicMLDataSet();

    for (final MLData dataItem : this.data) {
      result.add(dataItem);
    }

    return result;
  }
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.