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 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
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 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()
-
-
-
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 interfaceOptimizable.ByGradientValue
-
getValueGradient
public void getValueGradient(double[] buffer)
- Specified by:
getValueGradient
in interfaceOptimizable.ByGradientValue
-
getNumParameters
public int getNumParameters()
- Specified by:
getNumParameters
in interfaceOptimizable
-
getParameters
public void getParameters(double[] buffer)
- Specified by:
getParameters
in interfaceOptimizable
-
getParameter
public double getParameter(int index)
- Specified by:
getParameter
in interfaceOptimizable
-
setParameters
public void setParameters(double[] buff)
- Specified by:
setParameters
in interfaceOptimizable
-
setParameter
public void setParameter(int index, double value)
- Specified by:
setParameter
in interfaceOptimizable
-
setGaussianPriorVariance
public void setGaussianPriorVariance(double value)
-
shutdown
public void shutdown()
-
-