cc.mallet.grmm.learning
Class PiecewiseACRFTrainer.Maxable
java.lang.Object
cc.mallet.grmm.util.CachingOptimizable.ByGradient
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
infiniteValues
protected java.util.BitSet infiniteValues
PiecewiseACRFTrainer.Maxable
protected PiecewiseACRFTrainer.Maxable(ACRF acrf,
InstanceList ilist)
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()