cc.mallet.fst.semi_supervised
Class GELattice
- java.lang.Object
-
- cc.mallet.fst.semi_supervised.GELattice
-
public class GELattice extends java.lang.ObjectRuns 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 gdruck NOTE: This new version of GE Lattice that computes the gradient for all constraints simultaneously!
-
-
Constructor Summary
Constructors Constructor and Description GELattice(FeatureVectorSequence fvs, double[][] gammas, double[][][] xis, Transducer transducer, int[][] reverseTrans, int[][] reverseTransIndices, CRF.Factors gradient, java.util.ArrayList<GEConstraint> constraints, boolean check)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcheck(java.util.ArrayList<GEConstraint> constraints, double[][] gammas, double[][][] xis, FeatureVectorSequence fvs)Verifies the correctness of the lattice computations.LogNumbergetAlpha(int ip, int s1, int s2)LogNumbergetBeta(int ip, int s1, int s2)
-
-
-
Constructor Detail
-
GELattice
public GELattice(FeatureVectorSequence fvs, double[][] gammas, double[][][] xis, Transducer transducer, int[][] reverseTrans, int[][] reverseTransIndices, CRF.Factors gradient, java.util.ArrayList<GEConstraint> constraints, boolean check)
- Parameters:
fvs- Input FeatureVectorSequencegammas- Marginals over single statesxis- Marginals over pairs of statestransducer- TransducerreverseTrans- Source state indices for each destination statereverseTransIndices- Transition indices for each destination stategradient- Gradient to incrementconstraints- List of constraintscheck- Whether to run the debugging test to verify correctness (will be much slower if true)
-
-
Method Detail
-
check
public void check(java.util.ArrayList<GEConstraint> constraints, double[][] gammas, double[][][] xis, FeatureVectorSequence fvs)
Verifies the correctness of the lattice computations.
-
getAlpha
public LogNumber getAlpha(int ip, int s1, int s2)
-
getBeta
public LogNumber getBeta(int ip, int s1, int s2)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG