Package cc.mallet.fst.semi_supervised.pr
Class CRFOptimizableByKL
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description protected PRAuxiliaryModelauxModelprotected double[]cachedGradientprotected intcachedGradientWeightsStampprotected doublecachedValueprotected intcachedValueWeightsStampprotected CRF.Factorsconstraintsprotected CRFcrfprotected java.util.concurrent.ThreadPoolExecutorexecutorprotected CRF.Factorsexpectationsprotected java.util.List<double[]>finalProbListprotected doublegaussianPriorVarianceprotected java.util.List<double[]>initialProbListprotected intnumParametersprotected intnumThreadsprotected InstanceListtrainingSetprotected java.util.List<double[][][]>transitionProbListprotected doubleweight
-
Constructor Summary
Constructors Constructor Description CRFOptimizableByKL(CRF crf, InstanceList trainingSet, PRAuxiliaryModel auxModel, double[][][][] cachedDots, int numThreads, double weight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidgatherConstraints(PRAuxiliaryModel auxModel, double[][][][] cachedDots)protected doublegetExpectationValue()intgetNumParameters()doublegetParameter(int index)voidgetParameters(double[] buffer)doublegetValue()voidgetValueGradient(double[] buffer)voidsetGaussianPriorVariance(double value)voidsetParameter(int index, double value)voidsetParameters(double[] buff)voidshutdown()
-
-
-
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:
getValuein interfaceOptimizable.ByGradientValue
-
getValueGradient
public void getValueGradient(double[] buffer)
- Specified by:
getValueGradientin interfaceOptimizable.ByGradientValue
-
getNumParameters
public int getNumParameters()
- Specified by:
getNumParametersin interfaceOptimizable
-
getParameters
public void getParameters(double[] buffer)
- Specified by:
getParametersin interfaceOptimizable
-
getParameter
public double getParameter(int index)
- Specified by:
getParameterin interfaceOptimizable
-
setParameters
public void setParameters(double[] buff)
- Specified by:
setParametersin interfaceOptimizable
-
setParameter
public void setParameter(int index, double value)- Specified by:
setParameterin interfaceOptimizable
-
setGaussianPriorVariance
public void setGaussianPriorVariance(double value)
-
shutdown
public void shutdown()
-
-