cc.mallet.fst.semi_supervised
Class GELattice
java.lang.Object
cc.mallet.fst.semi_supervised.GELattice
public class GELattice
- extends java.lang.Object
Runs the dynamic programming algorithm of [Mann and McCallum 08] for
computing the gradient of a Generalized Expectation constraint that
considers a single label of a linear chain CRF.
See:
"Generalized Expectation Criteria for Semi-Supervised Learning of Conditional Random Fields"
Gideon Mann and Andrew McCallum
ACL 2008
- Author:
- Gregory Druck, Gaurav Chandalia
|
Nested Class Summary |
protected class |
GELattice.LatticeNode
Contains forward-backward vectors correspoding to an input position and a
state index. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
latticeLength
protected int latticeLength
transducer
protected Transducer transducer
numStates
protected int numStates
lattice
protected GELattice.LatticeNode[][] lattice
transGradientCache
protected double[][][] transGradientCache
GELattice
public GELattice(FeatureVectorSequence fvs,
double[][] gammas,
double[][][] xis,
Transducer transducer,
Transducer.Incrementor incrementor,
GECriteria geCriteria,
boolean check)
logValueOfIndicatorFeature
public static final double logValueOfIndicatorFeature(FeatureVectorSequence fvs,
int fi,
int ip)
- Returns indicator value of feature at specified position in logspace.
Returns: 0.0 for log(1),
Transducer.IMPOSSIBLE_WEIGHT for log(0).
check
public void check(double[][] gammas,
double[][][] xis,
int li,
int fi,
FeatureVectorSequence fvs)
- Verifies the correctness of the lattice computations.