calhoun.analysis.crf.solver
Class LookbackBuffer

java.lang.Object
  extended by calhoun.analysis.crf.solver.LookbackBuffer

public final class LookbackBuffer
extends java.lang.Object

This object holds information about previous positions during the computation of betas and expectations. This allows us to quickly access data about previous positions. These objects are kept in a recycling buffer that keeps one buffer for each possible lookback.

One tricky aspect of this is that the details change slightly between the forward and backwards pass. On the forward pass, the lookback contains the information in the normal way. In the backwards pass, stable states and transitions are shifted back one base compared to the betas.


Field Summary
 double[] beta
           
 int betaNorm
           
 double[] mi
           
 int pos
           
 double[] stableState
           
 double[] transitionProb
           
 
Constructor Summary
LookbackBuffer(int states, int transitions)
           
 
Method Summary
 void clear()
          mi and stableStates are cleared as new values are entered.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pos

public int pos

mi

public double[] mi

transitionProb

public double[] transitionProb

stableState

public double[] stableState

beta

public double[] beta

betaNorm

public int betaNorm
Constructor Detail

LookbackBuffer

public LookbackBuffer(int states,
                      int transitions)
Method Detail

clear

public void clear()
mi and stableStates are cleared as new values are entered. This fixes the others