Package org.encog.ml.data

Examples of org.encog.ml.data.MLDataPair


  public MLDataPair get(int index) {
    if( index>=size() ) {
      return null;
    }
   
    MLDataPair result = BasicMLDataPair.createPair(getInputSize(),
        this.getIdealSize());
    getRecord(index, result);
    return result;
  }
View Full Code Here


    synchronized (this.data) {
      if (!hasNext()) {
        return null;
      }

      final MLDataPair pair = BasicMLDataPair.createPair(
          this.data.getInputSize(), this.data.getIdealSize());
      this.data.getRecord(this.current++, pair);
      return pair;
    }
  }
View Full Code Here

    return (int) getRecordCount();
  }

  @Override
  public MLDataPair get(int index) {
    MLDataPair result = BasicMLDataPair.createPair(getInputSize(),
        getIdealSize());
    this.getRecord(index, result);
    return result;
  }
View Full Code Here

  @Override
  public boolean read(final double[] input, final double[] ideal, final double[] significance) {
    if (!iterator.hasNext()) {
      return false;
    } else {
      MLDataPair pair = iterator.next();
      EngineArray.arrayCopy(pair.getInputArray(), input);
      EngineArray.arrayCopy(pair.getIdealArray(), ideal);
      significance[0] = pair.getSignificance();
      return true;
    }
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void write(final double[] input, final double[] ideal, double significance) {
    MLDataPair pair = BasicMLDataPair.createPair(inputSize,
        idealSize);
    EngineArray.arrayCopy(input, pair.getIdealArray());
    EngineArray.arrayCopy(ideal, pair.getIdealArray());
    pair.setSignificance(significance);
  }
View Full Code Here

    final Iterator<MLDataPair> seqIterator = sequence.iterator();
    seqIterator.next();

    for (int t = 0; t < (sequence.size() - 1); t++) {
      final MLDataPair observation = seqIterator.next();

      for (int i = 0; i < hmm.getStateCount(); i++) {
        for (int j = 0; j < hmm.getStateCount(); j++) {
          xi[t][i][j] = fbc.alphaElement(t, i)
              * hmm.getTransitionProbability(i, j)
View Full Code Here

    for (final MLDataSet obsSeq : this.sequnces.getSequences()) {
      final ViterbiCalculator vc = new ViterbiCalculator(obsSeq, hmm);
      final int states[] = vc.stateSequence();

      for (int i = 0; i < states.length; i++) {
        final MLDataPair o = obsSeq.get(i);

        if (this.clusters.cluster(o) != states[i]) {
          modif = true;
          this.clusters.remove(o, this.clusters.cluster(o));
          this.clusters.put(o, states[i]);
View Full Code Here

    final Iterator<MLDataPair> seqIterator = sequence.iterator();
    seqIterator.next();

    for (int t = 0; t < (sequence.size() - 1); t++) {
      final MLDataPair o = seqIterator.next();

      for (int i = 0; i < hmm.getStateCount(); i++) {
        for (int j = 0; j < hmm.getStateCount(); j++) {
          xi[t][i][j] = (fbc.alphaElement(t, i)
              * hmm.getTransitionProbability(i, j)
View Full Code Here

      if (this.codec.getIdealSize() > 0) {
        b = new BasicMLData(ideal);
      }

      final MLDataPair pair = new BasicMLDataPair(a, b);
      pair.setSignificance(significance[0]);
      this.result.add(pair);

      currentRecord++;
      lastUpdate++;
      if (lastUpdate >= 10000) {
View Full Code Here

    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);
View Full Code Here

TOP

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

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.