Package cc.mallet.fst.semi_supervised.pr
Class ConstraintsOptimizableByPR
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description protected double[][][][]cachedDotsprotected double[]cachedGradientprotected doublecachedValueprotected booleancacheStaleprotected CRFcrfprotected java.util.concurrent.ThreadPoolExecutorexecutorprotected intnumParametersprotected intnumThreadsprotected InstanceListtrainingSet
-
Constructor Summary
Constructors Constructor Description ConstraintsOptimizableByPR(CRF crf, InstanceList ilist, PRAuxiliaryModel model)ConstraintsOptimizableByPR(CRF crf, InstanceList ilist, PRAuxiliaryModel model, int numThreads)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcacheDotProducts()PRAuxiliaryModelgetAuxModel()double[][][][]getCachedDots()doublegetCompleteValueContribution()protected doublegetExpectationValue()intgetNumParameters()doublegetParameter(int index)voidgetParameters(double[] params)doublegetValue()Returns the log probability of the training sequence labels and the prior over parameters.voidgetValueGradient(double[] buffer)voidsetParameter(int index, double value)voidsetParameters(double[] params)voidshutdown()
-
-
-
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:
getNumParametersin interfaceOptimizable
-
getParameters
public void getParameters(double[] params)
- Specified by:
getParametersin interfaceOptimizable
-
getParameter
public double getParameter(int index)
- Specified by:
getParameterin interfaceOptimizable
-
setParameters
public void setParameters(double[] params)
- Specified by:
setParametersin interfaceOptimizable
-
setParameter
public void setParameter(int index, double value)- Specified by:
setParameterin interfaceOptimizable
-
getExpectationValue
protected double getExpectationValue()
-
getValue
public double getValue()
Returns the log probability of the training sequence labels and the prior over parameters.- Specified by:
getValuein interfaceOptimizable.ByGradientValue
-
getCompleteValueContribution
public double getCompleteValueContribution()
-
getValueGradient
public void getValueGradient(double[] buffer)
- Specified by:
getValueGradientin interfaceOptimizable.ByGradientValue
-
shutdown
public void shutdown()
-
getCachedDots
public double[][][][] getCachedDots()
-
getAuxModel
public PRAuxiliaryModel getAuxModel()
-
-