Examples of ViterbiCalculator


Examples of be.ac.ulg.montefiore.run.jahmm.ViterbiCalculator

    int cnt = 0;
    String line;

    while ((line = br.readLine()) != null) {
      ArrayList<ObservationInteger> seq = taxo.obSeqWithBoundarySymbols(line.split(" "));
      double p = (new ViterbiCalculator(seq, this)).lnProbability();
      sumProb += Math.exp(p);
      sumLogProb += p;
      cnt++;
    }
    return sumLogProb;
View Full Code Here

Examples of be.ac.ulg.montefiore.run.jahmm.ViterbiCalculator

   * @param seq The sequence to be evaluated
   * @return The log probability of that sequence
   */
  public double viterbiCalculate(ArrayList<String> seq) {
    ArrayList<ObservationInteger> oSeq = taxo.obSeqWithBoundarySymbols(seq);
    ViterbiCalculator vc = new ViterbiCalculator(oSeq, this);
    return vc.lnProbability();
  }
View Full Code Here

Examples of be.ac.ulg.montefiore.run.jahmm.ViterbiCalculator

   *
   * @param seq The sequence of symbols being evaluated
   * @return The most likely sequence of states to produce that sequence
   */
  public State[] viterbiPath(ArrayList<String> seq) {
    ViterbiCalculator vc = new ViterbiCalculator(taxo.obSeqWithBoundarySymbols(seq), this);
    int[] stateSequence = vc.stateSequence();
    State[] ms = new State[stateSequence.length];
    for (int i = 0; i < stateSequence.length; i++) {
      ms[i] = taxo.getState(stateSequence[i]);
    }
    return ms;
View Full Code Here

Examples of org.encog.ml.hmm.alog.ViterbiCalculator

    return this.stateDistributions[i];
  }

  @Override
  public int[] getStatesForSequence(final MLDataSet seq) {
    return (new ViterbiCalculator(seq, this)).stateSequence();
  }
View Full Code Here

Examples of org.encog.ml.hmm.alog.ViterbiCalculator

  private boolean optimizeCluster(final HiddenMarkovModel hmm) {
    boolean modif = false;

    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]) {
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.