cc.mallet.grmm.learning
Class PwplACRFTrainer.Maxable

java.lang.Object
  extended by cc.mallet.grmm.util.CachingOptimizable.ByGradient
      extended by cc.mallet.grmm.learning.PwplACRFTrainer.Maxable
All Implemented Interfaces:
Optimizable, Optimizable.ByGradientValue
Enclosing class:
PwplACRFTrainer

public class PwplACRFTrainer.Maxable
extends CachingOptimizable.ByGradient


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  java.util.BitSet infiniteValues
           
 
Constructor Summary
protected PwplACRFTrainer.Maxable(ACRF acrf, InstanceList ilist)
           
 
Method Summary
 void collectConstraints(InstanceList ilist)
           
protected  double computeValue()
           
protected  void computeValueGradient(double[] grad)
          Computes the gradient of the penalized log likelihood of the ACRF, and places it in cachedGradient[].
 SparseVector[] getConstraints(int cnum)
           
 SparseVector[] getExpectations(int cnum)
           
 double getGaussianPriorVariance()
           
 int getNumParameters()
           
 void getParameters(double[] buf)
           
 void printParameters()
          print weights
 void setGaussianPriorVariance(double gaussianPriorVariance)
           
protected  void setParametersInternal(double[] params)
           
 
Methods inherited from class cc.mallet.grmm.util.CachingOptimizable.ByGradient
getValue, getValueGradient, setCachedGradient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cc.mallet.optimize.Optimizable
getParameter, setParameter, setParameters
 

Field Detail

infiniteValues

protected java.util.BitSet infiniteValues
Constructor Detail

PwplACRFTrainer.Maxable

protected PwplACRFTrainer.Maxable(ACRF acrf,
                                  InstanceList ilist)
Method Detail

getGaussianPriorVariance

public double getGaussianPriorVariance()

setGaussianPriorVariance

public void setGaussianPriorVariance(double gaussianPriorVariance)

getNumParameters

public int getNumParameters()

getParameters

public void getParameters(double[] buf)

setParametersInternal

protected void setParametersInternal(double[] params)

getExpectations

public SparseVector[] getExpectations(int cnum)

getConstraints

public SparseVector[] getConstraints(int cnum)

printParameters

public void printParameters()
print weights


computeValue

protected double computeValue()
Specified by:
computeValue in class CachingOptimizable.ByGradient

computeValueGradient

protected void computeValueGradient(double[] grad)
Computes the gradient of the penalized log likelihood of the ACRF, and places it in cachedGradient[].

Gradient is constraint - expectation - parameters/gaussianPriorVariance

Specified by:
computeValueGradient in class CachingOptimizable.ByGradient

collectConstraints

public void collectConstraints(InstanceList ilist)