Package cc.mallet.fst.semi_supervised
Class EntropyLattice
- java.lang.Object
-
- cc.mallet.fst.semi_supervised.EntropyLattice
-
public class EntropyLattice extends java.lang.Object
Runs subsequence constrained forward-backward to compute the entropy of label sequences.Reference: Gideon Mann, Andrew McCallum "Efficient Computation of Entropy Gradient for Semi-Supervised Conditional Random Fields" HLT/NAACL 2007
- Author:
- Gideon Mann, Gaurav Chandalia, Gregory Druck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
EntropyLattice.LatticeNode
Contains alpha, beta values at a particular input position and state pair.
-
Field Summary
Fields Modifier and Type Field Description protected double
entropy
protected int
inputLength
protected int
latticeLength
protected EntropyLattice.LatticeNode[][]
nodes
protected int
numStates
protected Transducer
transducer
-
Constructor Summary
Constructors Constructor Description EntropyLattice(FeatureVectorSequence fvs, double[][] gammas, double[][][] xis, Transducer transducer, Transducer.Incrementor incrementor, double scalingFactor)
Runs constrained forward-backward.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
backwardLattice(double[][] gammas, double[][][] xis)
Computes the backward entropies (H^beta).double
forwardLattice(double[][] gammas, double[][][] xis)
Computes the forward entropies (H^alpha).double
getEntropy()
EntropyLattice.LatticeNode
getLatticeNode(int ip, int si)
-
-
-
Field Detail
-
latticeLength
protected int latticeLength
-
inputLength
protected int inputLength
-
transducer
protected Transducer transducer
-
numStates
protected int numStates
-
nodes
protected EntropyLattice.LatticeNode[][] nodes
-
entropy
protected double entropy
-
-
Constructor Detail
-
EntropyLattice
public EntropyLattice(FeatureVectorSequence fvs, double[][] gammas, double[][][] xis, Transducer transducer, Transducer.Incrementor incrementor, double scalingFactor)
Runs constrained forward-backward.If incrementor is null then do not update expectations due to these computations.
The contribution of entropy to the expectations is multiplies by the scaling factor.
-
-
Method Detail
-
getEntropy
public double getEntropy()
-
forwardLattice
public double forwardLattice(double[][] gammas, double[][][] xis)
Computes the forward entropies (H^alpha).
-
backwardLattice
public double backwardLattice(double[][] gammas, double[][][] xis)
Computes the backward entropies (H^beta).
-
getLatticeNode
public EntropyLattice.LatticeNode getLatticeNode(int ip, int si)
-
-