cc.mallet.fst.semi_supervised.pr
Class CRFTrainerByPR

java.lang.Object
  extended by cc.mallet.fst.TransducerTrainer
      extended by cc.mallet.fst.semi_supervised.pr.CRFTrainerByPR
All Implemented Interfaces:
TransducerTrainer.ByOptimization

public class CRFTrainerByPR
extends TransducerTrainer
implements TransducerTrainer.ByOptimization

Posterior regularization trainer.

Author:
Gregory Druck

Nested Class Summary
 
Nested classes/interfaces inherited from class cc.mallet.fst.TransducerTrainer
TransducerTrainer.ByIncrements, TransducerTrainer.ByInstanceIncrements, TransducerTrainer.ByOptimization
 
Constructor Summary
CRFTrainerByPR(CRF crf, java.util.ArrayList<PRConstraint> constraints)
           
CRFTrainerByPR(CRF crf, java.util.ArrayList<PRConstraint> constraints, int numThreads)
           
 
Method Summary
 int getIteration()
           
 Optimizer getOptimizer()
           
 double getQValue()
           
 double getTotalValue()
           
 Transducer getTransducer()
           
 boolean isFinishedTraining()
           
 void setPGaussianPriorVariance(double pGpv)
           
 void setStateLabelMap(StateLabelMap map)
           
 void setTolerance(double tolerance)
           
 boolean train(InstanceList train, int numIterations)
          Train the transducer associated with this TransducerTrainer.
 boolean train(InstanceList train, int minIter, int maxIter)
           
 boolean train(InstanceList train, int minIter, int maxIter, int maxIterPerStep)
           
 
Methods inherited from class cc.mallet.fst.TransducerTrainer
addEvaluator, addEvaluators, removeEvaluator, runEvaluators, train
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRFTrainerByPR

public CRFTrainerByPR(CRF crf,
                      java.util.ArrayList<PRConstraint> constraints)

CRFTrainerByPR

public CRFTrainerByPR(CRF crf,
                      java.util.ArrayList<PRConstraint> constraints,
                      int numThreads)
Method Detail

getIteration

public int getIteration()
Specified by:
getIteration in class TransducerTrainer

getTransducer

public Transducer getTransducer()
Specified by:
getTransducer in class TransducerTrainer

isFinishedTraining

public boolean isFinishedTraining()
Specified by:
isFinishedTraining in class TransducerTrainer

setStateLabelMap

public void setStateLabelMap(StateLabelMap map)

setPGaussianPriorVariance

public void setPGaussianPriorVariance(double pGpv)

setTolerance

public void setTolerance(double tolerance)

train

public boolean train(InstanceList train,
                     int numIterations)
Description copied from class: TransducerTrainer
Train the transducer associated with this TransducerTrainer. You should be able to call this method with different trainingSet objects. Whether this causes the TransducerTrainer to combine both trainingSets or to view the second as a new alternative is at the discretion of the particular TransducerTrainer subclass involved.

Specified by:
train in class TransducerTrainer

train

public boolean train(InstanceList train,
                     int minIter,
                     int maxIter)

train

public boolean train(InstanceList train,
                     int minIter,
                     int maxIter,
                     int maxIterPerStep)

getTotalValue

public double getTotalValue()

getQValue

public double getQValue()

getOptimizer

public Optimizer getOptimizer()
Specified by:
getOptimizer in interface TransducerTrainer.ByOptimization