cc.mallet.grmm.learning
Class PiecewiseACRFTrainer.Maxable

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

public static class PiecewiseACRFTrainer.Maxable
extends CachingOptimizable.ByGradient
implements java.io.Serializable

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  java.util.BitSet infiniteValues
           
 
Constructor Summary
protected PiecewiseACRFTrainer.Maxable(ACRF acrf, InstanceList ilist)
           
 
Method Summary
 void collectConstraints(InstanceList ilist)
           
protected  double computeValue()
           
 double computeValueAndGradient(int instance)
           
protected  void computeValueGradient(double[] grad)
          Computes the gradient of the penalized log likelihood of the ACRF, and places it in cachedGradient[].
 void getCachedGradient(double[] grad)
           
 SparseVector[] getConstraints(int cnum)
           
 SparseVector[] getExpectations(int cnum)
           
 double getGaussianPriorVariance()
           
 int getNumInstances()
           
 int getNumParameters()
           
 void getParameters(double[] buf)
           
 void printParameters()
          print weights
 void resetValueGradient()
           
 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

PiecewiseACRFTrainer.Maxable

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

getGaussianPriorVariance

public double getGaussianPriorVariance()

setGaussianPriorVariance

public void setGaussianPriorVariance(double gaussianPriorVariance)

getNumParameters

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

getParameters

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

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)

computeValueAndGradient

public double computeValueAndGradient(int instance)

getNumInstances

public int getNumInstances()

getCachedGradient

public void getCachedGradient(double[] grad)

resetValueGradient

public void resetValueGradient()