calhoun.analysis.crf.solver
Class CacheProcessorDeluxe

java.lang.Object
  extended by calhoun.analysis.crf.solver.CacheProcessorBasic
      extended by calhoun.analysis.crf.solver.CacheProcessorDeluxe
All Implemented Interfaces:
CacheProcessor

public class CacheProcessorDeluxe
extends CacheProcessorBasic

A policy based cache processor. This is the main cache processor used. It uses the cache policies specified by the feature managers to efficent cache all feature values. The distinct caching strategies recognized by this CacheProcessor are:


Nested Class Summary
 
Nested classes/interfaces inherited from interface calhoun.analysis.crf.solver.CacheProcessor
CacheProcessor.FeatureEvaluation, CacheProcessor.LengthFeatureEvaluation, CacheProcessor.SolverSetup, CacheProcessor.StatePotentials
 
Field Summary
 boolean[] invalidTransitions
           
 
Constructor Summary
CacheProcessorDeluxe()
           
CacheProcessorDeluxe(CacheStrategySpec.CacheStrategy strategy)
           
 
Method Summary
 void checkConstraintsInTrainingData()
           
 void evaluatePosition(int seq, int pos)
           
 void evaluateSegmentsEndingAt(int seq, int pos)
          The job of this function is to update the table "LengthFeatureEvaluation[][] lengthEvals" The first dimension is index by those states which have at least one explicit length node feature, corresponding to the state of an interval which ends at position currently under consideration.
 boolean[] getInvalidTransitions()
           
 int getLookbackArrayFeatureSize()
           
 int getLookbackArraySize()
           
 boolean isAllPaths()
           
 boolean isIgnoreInvalidTrainingData()
           
 void setAllPaths(boolean allPaths)
           
 void setIgnoreInvalidTrainingData(boolean ignoreInvalidTrainingData)
           
 void setLookbackArrayFeatureSize(int lookbackArrayFeatureSize)
           
 void setLookbackArraySize(int lookbackArraySize)
           
 void setSemiMarkovSetup(SemiMarkovSetup setup)
           
 void setTrainingData(ModelManager fm, java.util.List<? extends TrainingSequence<?>> data)
           
 
Methods inherited from class calhoun.analysis.crf.solver.CacheProcessorBasic
getData, getFeatureEvaluations, getFeatureSums, getLengthFeatureEvaluations, getSequenceFeatureSums, getSolverSetup, getTrainingFile, setInputData, setTrainingFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

invalidTransitions

public boolean[] invalidTransitions
Constructor Detail

CacheProcessorDeluxe

public CacheProcessorDeluxe()

CacheProcessorDeluxe

public CacheProcessorDeluxe(CacheStrategySpec.CacheStrategy strategy)
Method Detail

setTrainingData

public void setTrainingData(ModelManager fm,
                            java.util.List<? extends TrainingSequence<?>> data)
Specified by:
setTrainingData in interface CacheProcessor
Overrides:
setTrainingData in class CacheProcessorBasic

checkConstraintsInTrainingData

public void checkConstraintsInTrainingData()

evaluatePosition

public void evaluatePosition(int seq,
                             int pos)

evaluateSegmentsEndingAt

public void evaluateSegmentsEndingAt(int seq,
                                     int pos)
The job of this function is to update the table "LengthFeatureEvaluation[][] lengthEvals" The first dimension is index by those states which have at least one explicit length node feature, corresponding to the state of an interval which ends at position currently under consideration. The size of this dimension is predetermined and is equal to modelInfo.statesWithLookback.length The second dimension is the length of the lookback, i.e. how many bases is the length of interval currently being considered. The size of this dimension is variable, and after the last of which one inserts a LengthFeatureEvaluation whose lookback is -1 A LengthFeatureEvaluation contains the lookback and a FeatureEvaluation for nodes, plus and edgeEvaluation (which for now we set to null). The FeatureEvaluations we have seen before; they are comprised of index and value arrays, which are of variable length, and after last entry you put a -1 in the index array.


getInvalidTransitions

public boolean[] getInvalidTransitions()

setSemiMarkovSetup

public void setSemiMarkovSetup(SemiMarkovSetup setup)

isAllPaths

public boolean isAllPaths()

setAllPaths

public void setAllPaths(boolean allPaths)

getLookbackArrayFeatureSize

public int getLookbackArrayFeatureSize()
Returns:
Returns the lookbackArrayFeatureSize.

setLookbackArrayFeatureSize

public void setLookbackArrayFeatureSize(int lookbackArrayFeatureSize)
Parameters:
lookbackArrayFeatureSize - The lookbackArrayFeatureSize to set.

getLookbackArraySize

public int getLookbackArraySize()
Returns:
Returns the lookbackArraySize.

setLookbackArraySize

public void setLookbackArraySize(int lookbackArraySize)
Parameters:
lookbackArraySize - The lookbackArraySize to set.

isIgnoreInvalidTrainingData

public boolean isIgnoreInvalidTrainingData()

setIgnoreInvalidTrainingData

public void setIgnoreInvalidTrainingData(boolean ignoreInvalidTrainingData)