Package cc.mallet.fst
Class SumLatticeBeam
- java.lang.Object
-
- cc.mallet.fst.SumLatticeBeam
-
- All Implemented Interfaces:
SumLattice
public class SumLatticeBeam extends java.lang.Object implements SumLattice
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SumLatticeBeam.Factory
-
Field Summary
Fields Modifier and Type Field Description protected static int
beamWidth
-
Constructor Summary
Constructors Constructor Description SumLatticeBeam(Transducer t, Sequence input, Sequence output, Transducer.Incrementor incrementor)
SumLatticeBeam(Transducer t, Sequence input, Sequence output, Transducer.Incrementor incrementor, boolean saveXis)
SumLatticeBeam(Transducer t, Sequence input, Sequence output, Transducer.Incrementor incrementor, boolean saveXis, LabelAlphabet outputAlphabet)
SumLatticeBeam(Transducer t, Sequence input, Sequence output, Transducer.Incrementor incrementor, LabelAlphabet outputAlphabet, int[] constraints)
Create a lattice that constrains its transitions such that thepairs in "constraints" are adhered to.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getAlpha(int ip, Transducer.State s)
int
getBeamWidth()
double
getBeta(int ip, Transducer.State s)
double
getGammaProbability(int inputPosition, Transducer.State s)
double[][]
getGammas()
double
getGammaWeight(int inputPosition, Transducer.State s)
Sequence
getInput()
LabelVector
getLabelingAtPosition(int outputPosition)
double[]
getNstatesExpl()
int
getTctIter()
double
getTotalWeight()
Transducer
getTransducer()
boolean
getUseForwardBackwardBeam()
double
getXiProbability(int ip, Transducer.State s1, Transducer.State s2)
double[][][]
getXis()
double
getXiWeight(int ip, Transducer.State s1, Transducer.State s2)
void
incIter()
int
length()
void
setBeamWidth(int beamWidth)
void
setCurIter(int curIter)
void
setKLeps(double KLeps)
void
setRmin(double Rmin)
void
setUseForwardBackwardBeam(boolean state)
-
-
-
Constructor Detail
-
SumLatticeBeam
public SumLatticeBeam(Transducer t, Sequence input, Sequence output, Transducer.Incrementor incrementor)
-
SumLatticeBeam
public SumLatticeBeam(Transducer t, Sequence input, Sequence output, Transducer.Incrementor incrementor, boolean saveXis)
-
SumLatticeBeam
public SumLatticeBeam(Transducer t, Sequence input, Sequence output, Transducer.Incrementor incrementor, boolean saveXis, LabelAlphabet outputAlphabet)
-
SumLatticeBeam
public SumLatticeBeam(Transducer t, Sequence input, Sequence output, Transducer.Incrementor incrementor, LabelAlphabet outputAlphabet, int[] constraints)
Create a lattice that constrains its transitions such that thepairs in "constraints" are adhered to. constraints is an array where each entry is the index of the required label at that position. An entry of 0 means there are no constraints on that . Positive values mean the path must pass through that state. Negative values mean the path must _not_ pass through that state. NOTE - constraints.length must be equal to output.size() + 1. A lattice has one extra position for the initial state. Generally, this should be unconstrained, since it does not produce an observation.
-
-
Method Detail
-
getBeamWidth
public int getBeamWidth()
-
setBeamWidth
public void setBeamWidth(int beamWidth)
-
getTctIter
public int getTctIter()
-
setCurIter
public void setCurIter(int curIter)
-
incIter
public void incIter()
-
setKLeps
public void setKLeps(double KLeps)
-
setRmin
public void setRmin(double Rmin)
-
getNstatesExpl
public double[] getNstatesExpl()
-
getUseForwardBackwardBeam
public boolean getUseForwardBackwardBeam()
-
setUseForwardBackwardBeam
public void setUseForwardBackwardBeam(boolean state)
-
getInput
public Sequence getInput()
- Specified by:
getInput
in interfaceSumLattice
-
getTotalWeight
public double getTotalWeight()
- Specified by:
getTotalWeight
in interfaceSumLattice
-
getGammaWeight
public double getGammaWeight(int inputPosition, Transducer.State s)
- Specified by:
getGammaWeight
in interfaceSumLattice
-
getGammaProbability
public double getGammaProbability(int inputPosition, Transducer.State s)
- Specified by:
getGammaProbability
in interfaceSumLattice
-
getXis
public double[][][] getXis()
- Specified by:
getXis
in interfaceSumLattice
-
getGammas
public double[][] getGammas()
- Specified by:
getGammas
in interfaceSumLattice
-
getXiProbability
public double getXiProbability(int ip, Transducer.State s1, Transducer.State s2)
- Specified by:
getXiProbability
in interfaceSumLattice
-
getXiWeight
public double getXiWeight(int ip, Transducer.State s1, Transducer.State s2)
- Specified by:
getXiWeight
in interfaceSumLattice
-
length
public int length()
- Specified by:
length
in interfaceSumLattice
-
getAlpha
public double getAlpha(int ip, Transducer.State s)
- Specified by:
getAlpha
in interfaceSumLattice
-
getBeta
public double getBeta(int ip, Transducer.State s)
- Specified by:
getBeta
in interfaceSumLattice
-
getLabelingAtPosition
public LabelVector getLabelingAtPosition(int outputPosition)
- Specified by:
getLabelingAtPosition
in interfaceSumLattice
-
getTransducer
public Transducer getTransducer()
- Specified by:
getTransducer
in interfaceSumLattice
-
-