cc.mallet.fst.semi_supervised.pr
Class SumLatticePR

java.lang.Object
  extended by cc.mallet.fst.semi_supervised.pr.SumLatticePR
All Implemented Interfaces:
SumLattice

public class SumLatticePR
extends java.lang.Object
implements SumLattice

Lattice for E-step/I-projection in PR.

Author:
Gregory Druck, Kedar Bellare

Nested Class Summary
protected  class SumLatticePR.LatticeNode
           
 
Field Summary
protected  double[][] gammas
           
protected  LabelVector[] labelings
           
protected  int latticeLength
           
protected  SumLatticePR.LatticeNode[][] nodes
           
protected  double totalWeight
           
protected  Transducer transducer
           
protected  double[][][] xis
           
 
Constructor Summary
SumLatticePR(Transducer trans, int index, Sequence input, Sequence output, PRAuxiliaryModel auxModel, double[][][] cachedDots, boolean incrementConstraints, Transducer.Incrementor incrementor, LabelAlphabet outputAlphabet, boolean saveXis)
           
 
Method Summary
 double getAlpha(int ip, Transducer.State s)
           
 double getBeta(int ip, Transducer.State s)
           
 double getGammaProbability(int inputPosition, int stateIndex)
           
 double getGammaProbability(int inputPosition, Transducer.State s)
           
 double[][] getGammas()
           
 double getGammaWeight(int inputPosition, int stateIndex)
           
 double getGammaWeight(int inputPosition, Transducer.State s)
           
 Sequence getInput()
           
 LabelVector getLabelingAtPosition(int outputPosition)
           
protected  SumLatticePR.LatticeNode getLatticeNode(int ip, int stateIndex)
           
 double getTotalWeight()
           
 Transducer getTransducer()
           
 double getXiProbability(int ip, Transducer.State s1, Transducer.State s2)
           
 double[][][] getXis()
           
 double getXiWeight(int ip, Transducer.State s1, Transducer.State s2)
           
 int length()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

totalWeight

protected double totalWeight

latticeLength

protected int latticeLength

gammas

protected double[][] gammas

xis

protected double[][][] xis

labelings

protected LabelVector[] labelings

transducer

protected Transducer transducer

nodes

protected SumLatticePR.LatticeNode[][] nodes
Constructor Detail

SumLatticePR

public SumLatticePR(Transducer trans,
                    int index,
                    Sequence input,
                    Sequence output,
                    PRAuxiliaryModel auxModel,
                    double[][][] cachedDots,
                    boolean incrementConstraints,
                    Transducer.Incrementor incrementor,
                    LabelAlphabet outputAlphabet,
                    boolean saveXis)
Method Detail

getLatticeNode

protected SumLatticePR.LatticeNode getLatticeNode(int ip,
                                                  int stateIndex)

getXis

public double[][][] getXis()
Specified by:
getXis in interface SumLattice

getGammas

public double[][] getGammas()
Specified by:
getGammas in interface SumLattice

getTotalWeight

public double getTotalWeight()
Specified by:
getTotalWeight in interface SumLattice

getGammaWeight

public double getGammaWeight(int inputPosition,
                             Transducer.State s)
Specified by:
getGammaWeight in interface SumLattice

getGammaWeight

public double getGammaWeight(int inputPosition,
                             int stateIndex)

getGammaProbability

public double getGammaProbability(int inputPosition,
                                  Transducer.State s)
Specified by:
getGammaProbability in interface SumLattice

getGammaProbability

public double getGammaProbability(int inputPosition,
                                  int stateIndex)

getXiProbability

public double getXiProbability(int ip,
                               Transducer.State s1,
                               Transducer.State s2)
Specified by:
getXiProbability in interface SumLattice

getXiWeight

public double getXiWeight(int ip,
                          Transducer.State s1,
                          Transducer.State s2)
Specified by:
getXiWeight in interface SumLattice

length

public int length()
Specified by:
length in interface SumLattice

getAlpha

public double getAlpha(int ip,
                       Transducer.State s)
Specified by:
getAlpha in interface SumLattice

getBeta

public double getBeta(int ip,
                      Transducer.State s)
Specified by:
getBeta in interface SumLattice

getLabelingAtPosition

public LabelVector getLabelingAtPosition(int outputPosition)
Specified by:
getLabelingAtPosition in interface SumLattice

getTransducer

public Transducer getTransducer()
Specified by:
getTransducer in interface SumLattice

getInput

public Sequence getInput()
Specified by:
getInput in interface SumLattice