felix.operator
Class CRFOperator

java.lang.Object
  extended by java.lang.Thread
      extended by felix.dstruct.StatOperator
          extended by felix.operator.CRFOperator
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Runnable

public class CRFOperator
extends StatOperator

A CRF operator in Felix.

Author:
Ce Zhang

Nested Class Summary
 
Nested classes/interfaces inherited from class felix.dstruct.StatOperator
StatOperator.OPType
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 int nRuns
           
 
Fields inherited from class felix.dstruct.StatOperator
allRelevantFelixClause, belongsToBucket, clauseConstraints, commonCandidate, currentState, dataCrackerSignature, db, dd_PriorClauses, fq, inputPredicates, isBinaryArbLR, isMarginal, nStartingRules, outputPredicates, partitionedInto, throwAwayPredicatesNames, type
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CRFOperator(FelixQuery _fq, java.util.HashSet<FelixPredicate> _goalPredicates, FelixCommandOptions _opt)
          The constructor of CRFOperator.
 
Method Summary
 java.lang.String explain()
          Human-readable representation of the logic plan.
 void fastInfer(java.io.BufferedWriter bw)
          Conduct CRF infer WITH knowledge about partitioning which is parsed statically from the input program.
 int getPartitionSize()
          Estimate the number of sequences.
 void learn()
           
static double logAdd(double logX, double logY)
          Returns sum of given log numbers.
 void prepare()
          Prepares operator for execution.
 void prepareDMO(java.util.HashSet<tuffy.ra.ConjunctiveQuery> lrQueries, java.util.HashSet<tuffy.ra.ConjunctiveQuery> chainQueries)
          Generate Data Movement Operator used by this CRF Operator.
 void run()
          Executes operator.
 void slowInfer(java.io.BufferedWriter bw)
          Deprecated.  
 
Methods inherited from class felix.dstruct.StatOperator
clone, getAllDMOs, getPrecedence, getTargetPredicateIfHasOnlyOne, pushPredicateScopes, registerRelevantClause, sealDefinition, setPrecedence, toNoParString, toString, translateFelixClasesIntoFactorGraphEdgeQueries, translateFelixClasesIntoLearningQueriesForVictor
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nRuns

public int nRuns
Constructor Detail

CRFOperator

public CRFOperator(FelixQuery _fq,
                   java.util.HashSet<FelixPredicate> _goalPredicates,
                   FelixCommandOptions _opt)
The constructor of CRFOperator.

Parameters:
_fq - Felix query.
_goalPredicates - target predicates of this coref operator.
_opt - Command line options of this Felix run.
Method Detail

prepare

public void prepare()
Prepares operator for execution.

Specified by:
prepare in class StatOperator

run

public void run()
Executes operator.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class StatOperator

explain

public java.lang.String explain()
Description copied from class: StatOperator
Human-readable representation of the logic plan. Any valid Felix operator should implement this method. TODO: need to think out a better to explain physical plan. (e.g., a graph?)

Specified by:
explain in class StatOperator

fastInfer

public void fastInfer(java.io.BufferedWriter bw)
Conduct CRF infer WITH knowledge about partitioning which is parsed statically from the input program.

Parameters:
bw - Buffered writer to dump results.

slowInfer

public void slowInfer(java.io.BufferedWriter bw)
Deprecated. 

Conduct CRF infer WITHOUT knowledge about partitioning which is parsed statically from the input program.

Parameters:
bw - Buffered writer to dump results.

prepareDMO

public void prepareDMO(java.util.HashSet<tuffy.ra.ConjunctiveQuery> lrQueries,
                       java.util.HashSet<tuffy.ra.ConjunctiveQuery> chainQueries)
Generate Data Movement Operator used by this CRF Operator.

Parameters:
rules - rules defining this operator.

getPartitionSize

public int getPartitionSize()
Estimate the number of sequences.

Returns:

logAdd

public static double logAdd(double logX,
                            double logY)
Returns sum of given log numbers.

Parameters:
logX -
logY -
Returns:

learn

public void learn()
Specified by:
learn in class StatOperator