|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.fst.CRF.Factors
public static class CRF.Factors
A simple, transparent container to hold the parameters or sufficient statistics for the CRF.
Nested Class Summary | |
---|---|
class |
CRF.Factors.Incrementor
Instances of this inner class can be passed to various inference methods, which can then gather/increment sufficient statistics counts into the containing Factor instance. |
class |
CRF.Factors.WeightedIncrementor
|
Field Summary | |
---|---|
double[] |
defaultWeights
|
double[] |
finalWeights
|
double[] |
initialWeights
|
Alphabet |
weightAlphabet
|
SparseVector[] |
weights
|
boolean[] |
weightsFrozen
|
Constructor Summary | |
---|---|
CRF.Factors()
Construct a new empty Factors with a new empty weightsAlphabet, 0-length initialWeights and finalWeights, and the other arrays null. |
|
CRF.Factors(CRF.Factors other)
Construct new Factors by mimicking the structure of the other one, but with zero values. |
|
CRF.Factors(CRF.Factors other,
boolean cloneAlphabet)
Construct new Factors by copying the other one. |
|
CRF.Factors(CRF crf)
Construct a new Factors with the same structure as the parameters of 'crf', but with values initialized to zero. |
Method Summary | |
---|---|
void |
assertNotNaN()
|
void |
assertNotNaNOrInfinite()
|
double |
gaussianPrior(double variance)
Return the log(p(parameters)) according to a zero-mean Gaussian with given variance. |
int |
getNumFactors()
|
double |
getParameter(int index)
|
void |
getParameters(double[] buffer)
|
double |
getParametersAbsNorm()
|
double |
hyberbolicPrior(double slope,
double sharpness)
Return the log(p(parameters)) according to a a hyperbolic curve that is a smooth approximation to an L1 prior. |
void |
plusEquals(CRF.Factors other,
double factor)
|
void |
plusEquals(CRF.Factors other,
double factor,
boolean obeyWeightsFrozen)
|
void |
plusEqualsGaussianPriorGradient(CRF.Factors other,
double variance)
|
void |
plusEqualsHyperbolicPriorGradient(CRF.Factors other,
double slope,
double sharpness)
|
void |
setParameter(int index,
double value)
|
void |
setParameters(double[] buff)
|
boolean |
structureMatches(CRF.Factors other)
|
void |
zero()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Alphabet weightAlphabet
public SparseVector[] weights
public double[] defaultWeights
public boolean[] weightsFrozen
public double[] initialWeights
public double[] finalWeights
Constructor Detail |
---|
public CRF.Factors()
public CRF.Factors(CRF.Factors other)
public CRF.Factors(CRF.Factors other, boolean cloneAlphabet)
public CRF.Factors(CRF crf)
Method Detail |
---|
public int getNumFactors()
public void zero()
public boolean structureMatches(CRF.Factors other)
public void assertNotNaN()
public void assertNotNaNOrInfinite()
public void plusEquals(CRF.Factors other, double factor)
public void plusEquals(CRF.Factors other, double factor, boolean obeyWeightsFrozen)
public double gaussianPrior(double variance)
public void plusEqualsGaussianPriorGradient(CRF.Factors other, double variance)
public double hyberbolicPrior(double slope, double sharpness)
public void plusEqualsHyperbolicPriorGradient(CRF.Factors other, double slope, double sharpness)
public double getParametersAbsNorm()
public void getParameters(double[] buffer)
public double getParameter(int index)
public void setParameters(double[] buff)
public void setParameter(int index, double value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |