cc.mallet.fst.semi_supervised.pr
Class CRFOptimizableByKL

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

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

M-step/M-projection for 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  PRAuxiliaryModel auxModel
           
protected  double[] cachedGradient
           
protected  int cachedGradientWeightsStamp
           
protected  double cachedValue
           
protected  int cachedValueWeightsStamp
           
protected  CRF.Factors constraints
           
protected  CRF crf
           
protected  java.util.concurrent.ThreadPoolExecutor executor
           
protected  CRF.Factors expectations
           
protected  java.util.List<double[]> finalProbList
           
protected  double gaussianPriorVariance
           
protected  java.util.List<double[]> initialProbList
           
protected  int numParameters
           
protected  int numThreads
           
protected  InstanceList trainingSet
           
protected  java.util.List<double[][][]> transitionProbList
           
protected  double weight
           
 
Constructor Summary
CRFOptimizableByKL(CRF crf, InstanceList trainingSet, PRAuxiliaryModel auxModel, double[][][][] cachedDots, int numThreads, double weight)
           
 
Method Summary
protected  void gatherConstraints(PRAuxiliaryModel auxModel, double[][][][] cachedDots)
           
protected  double getExpectationValue()
           
 int getNumParameters()
           
 double getParameter(int index)
           
 void getParameters(double[] buffer)
           
 double getValue()
           
 void getValueGradient(double[] buffer)
           
 void setGaussianPriorVariance(double value)
           
 void setParameter(int index, double value)
           
 void setParameters(double[] buff)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cachedValueWeightsStamp

protected int cachedValueWeightsStamp

cachedGradientWeightsStamp

protected int cachedGradientWeightsStamp

numParameters

protected int numParameters

numThreads

protected int numThreads

weight

protected double weight

gaussianPriorVariance

protected double gaussianPriorVariance

cachedValue

protected double cachedValue

cachedGradient

protected double[] cachedGradient

initialProbList

protected java.util.List<double[]> initialProbList

finalProbList

protected java.util.List<double[]> finalProbList

transitionProbList

protected java.util.List<double[][][]> transitionProbList

trainingSet

protected InstanceList trainingSet

crf

protected CRF crf

constraints

protected CRF.Factors constraints

expectations

protected CRF.Factors expectations

executor

protected java.util.concurrent.ThreadPoolExecutor executor

auxModel

protected PRAuxiliaryModel auxModel
Constructor Detail

CRFOptimizableByKL

public CRFOptimizableByKL(CRF crf,
                          InstanceList trainingSet,
                          PRAuxiliaryModel auxModel,
                          double[][][][] cachedDots,
                          int numThreads,
                          double weight)
Method Detail

gatherConstraints

protected void gatherConstraints(PRAuxiliaryModel auxModel,
                                 double[][][][] cachedDots)

getExpectationValue

protected double getExpectationValue()

getValue

public double getValue()
Specified by:
getValue in interface Optimizable.ByGradientValue

getValueGradient

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

getNumParameters

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

getParameters

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

getParameter

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

setParameters

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

setParameter

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

setGaussianPriorVariance

public void setGaussianPriorVariance(double value)

shutdown

public void shutdown()