cc.mallet.fst.semi_supervised.pr
Class ConstraintsOptimizableByPR

java.lang.Object
  extended by cc.mallet.fst.semi_supervised.pr.ConstraintsOptimizableByPR
All Implemented Interfaces:
Optimizable, Optimizable.ByGradientValue, java.io.Serializable

public class ConstraintsOptimizableByPR
extends java.lang.Object
implements java.io.Serializable, Optimizable.ByGradientValue

Optimizable for E-step/I-projection in Posterior Regularization (PR).

Author:
Kedar Bellare, Gregory Druck
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface cc.mallet.optimize.Optimizable
Optimizable.ByBatchGradient, Optimizable.ByCombiningBatchGradient, Optimizable.ByGISUpdate, Optimizable.ByGradient, Optimizable.ByGradientValue, Optimizable.ByHessian, Optimizable.ByValue, Optimizable.ByVotedPerceptron
 
Field Summary
protected  double[][][][] cachedDots
           
protected  double[] cachedGradient
           
protected  double cachedValue
           
protected  boolean cacheStale
           
protected  CRF crf
           
protected  java.util.concurrent.ThreadPoolExecutor executor
           
protected  int numParameters
           
protected  int numThreads
           
protected  InstanceList trainingSet
           
 
Constructor Summary
ConstraintsOptimizableByPR(CRF crf, InstanceList ilist, PRAuxiliaryModel model)
           
ConstraintsOptimizableByPR(CRF crf, InstanceList ilist, PRAuxiliaryModel model, int numThreads)
           
 
Method Summary
 void cacheDotProducts()
           
 PRAuxiliaryModel getAuxModel()
           
 double[][][][] getCachedDots()
           
 double getCompleteValueContribution()
           
protected  double getExpectationValue()
           
 int getNumParameters()
           
 double getParameter(int index)
           
 void getParameters(double[] params)
           
 double getValue()
          Returns the log probability of the training sequence labels and the prior over parameters.
 void getValueGradient(double[] buffer)
           
 void setParameter(int index, double value)
           
 void setParameters(double[] params)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheStale

protected boolean cacheStale

numParameters

protected int numParameters

numThreads

protected int numThreads

trainingSet

protected InstanceList trainingSet

cachedValue

protected double cachedValue

cachedGradient

protected double[] cachedGradient

crf

protected CRF crf

executor

protected java.util.concurrent.ThreadPoolExecutor executor

cachedDots

protected double[][][][] cachedDots
Constructor Detail

ConstraintsOptimizableByPR

public ConstraintsOptimizableByPR(CRF crf,
                                  InstanceList ilist,
                                  PRAuxiliaryModel model)

ConstraintsOptimizableByPR

public ConstraintsOptimizableByPR(CRF crf,
                                  InstanceList ilist,
                                  PRAuxiliaryModel model,
                                  int numThreads)
Method Detail

cacheDotProducts

public void cacheDotProducts()

getNumParameters

public int getNumParameters()
Specified by:
getNumParameters in interface Optimizable

getParameters

public void getParameters(double[] params)
Specified by:
getParameters in interface Optimizable

getParameter

public double getParameter(int index)
Specified by:
getParameter in interface Optimizable

setParameters

public void setParameters(double[] params)
Specified by:
setParameters in interface Optimizable

setParameter

public void setParameter(int index,
                         double value)
Specified by:
setParameter in interface Optimizable

getExpectationValue

protected double getExpectationValue()

getValue

public double getValue()
Returns the log probability of the training sequence labels and the prior over parameters.

Specified by:
getValue in interface Optimizable.ByGradientValue

getCompleteValueContribution

public double getCompleteValueContribution()

getValueGradient

public void getValueGradient(double[] buffer)
Specified by:
getValueGradient in interface Optimizable.ByGradientValue

shutdown

public void shutdown()

getCachedDots

public double[][][][] getCachedDots()

getAuxModel

public PRAuxiliaryModel getAuxModel()