Package org.encog.engine.data

Examples of org.encog.engine.data.EngineData


   * implementation of EngineIndexableSet interface. It is added for
   * Encog-Engine compatibility.
   */
  @Override
  public void getRecord(long index, EngineData pair) {
    EngineData item = this.elements.get((int) index);
    pair.setInputArray(item.getInputArray());
    pair.setIdealArray(item.getIdealArray());
  }
View Full Code Here


   */
  public double calculateError(final EngineIndexableSet data) {
    final ErrorCalculation errorCalculation = new ErrorCalculation();

    final double[] actual = new double[this.outputCount];
    final EngineData pair = BasicEngineData.createPair(data.getInputSize(),
        data.getIdealSize());

    for (int i = 0; i < data.getRecordCount(); i++) {
      data.getRecord(i, pair);
      compute(pair.getInputArray(), actual);
      errorCalculation.updateError(actual, pair.getIdealArray());
    }
    return errorCalculation.calculate();
  }
View Full Code Here

  public void setTraining(EngineIndexableSet training) {
    this.training = training;
    this.trainingLength = (int) this.training.getRecordCount();

    final EngineData pair = BasicEngineData.createPair(
        flat.getInputCount(), flat.getOutputCount());

    this.inputArray = new float[training.getInputSize() * this.trainingLength];
    this.idealArray = new float[training.getIdealSize() * this.trainingLength];
   
    int inputIndex = 0;
    int idealIndex = 0;

    for (int i = 0; i < this.trainingLength; i++) {
      training.getRecord(i, pair);
      for (int col = 0; col < flat.getInputCount(); col++) {
        this.inputArray[inputIndex++] = (float) pair.getInputArray()[col];
      }

      for (int col = 0; col < flat.getOutputCount(); col++) {
        this.idealArray[idealIndex++] = (float) pair.getIdealArray()[col];
      }
    }

    final int errorSize = (int) training.getRecordCount();
    this.errors = new float[errorSize];
View Full Code Here

    this.inputArray = new float[inputSize * this.trainingLength];
    this.idealArray = new float[idealSize * this.trainingLength];
    this.paramArray = new int[10];

    final EngineData pair = BasicEngineData.createPair(
        flat.getInputCount(), flat.getOutputCount());

    int inputIndex = 0;
    int idealIndex = 0;

    for (int i = 0; i < this.trainingLength; i++) {
      training.getRecord(i, pair);
      for (int col = 0; col < flat.getInputCount(); col++) {
        this.inputArray[inputIndex++] = (float) pair.getInputArray()[col];
      }

      for (int col = 0; col < flat.getOutputCount(); col++) {
        this.idealArray[idealIndex++] = (float) pair.getIdealArray()[col];
      }
    }

  }
View Full Code Here

TOP

Related Classes of org.encog.engine.data.EngineData

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.