cc.mallet.fst.semi_supervised.pr.constraints
Class OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint

java.lang.Object
  extended by cc.mallet.fst.semi_supervised.pr.constraints.OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint
Enclosing class:
OneLabelL2IndPRConstraints

protected class OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint
extends java.lang.Object


Field Summary
protected  double count
           
protected  double[] expectation
           
protected  int index
           
protected  java.util.HashMap<java.lang.Integer,java.lang.Integer> labelMap
           
protected  java.util.ArrayList<java.lang.Integer> labels
           
protected  java.util.ArrayList<java.lang.Integer> paramIndices
           
protected  java.util.ArrayList<java.lang.Double> targets
           
protected  java.util.ArrayList<java.lang.Double> weights
           
 
Constructor Summary
OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint()
           
 
Method Summary
 void add(int label, double target, double weight, int paramIndex)
           
 void addExpectations(double[] expectations)
           
 OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint copy()
           
 double getCompleteValueContrib()
           
 void getExpectations(double[] expectations)
           
 void getGradient(double[] parameters, double[] gradient)
           
 int getNumConstrainedLabels()
           
 double getProjectionValueContrib(double[] parameters)
           
 double getScore(int li, double[] parameters)
           
 void incrementExpectation(int li, double value)
           
 void zeroExpectation()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

protected int index

count

protected double count

labels

protected java.util.ArrayList<java.lang.Integer> labels

paramIndices

protected java.util.ArrayList<java.lang.Integer> paramIndices

targets

protected java.util.ArrayList<java.lang.Double> targets

weights

protected java.util.ArrayList<java.lang.Double> weights

labelMap

protected java.util.HashMap<java.lang.Integer,java.lang.Integer> labelMap

expectation

protected double[] expectation
Constructor Detail

OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint

public OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint()
Method Detail

copy

public OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint copy()

add

public void add(int label,
                double target,
                double weight,
                int paramIndex)

zeroExpectation

public void zeroExpectation()

getExpectations

public void getExpectations(double[] expectations)

addExpectations

public void addExpectations(double[] expectations)

incrementExpectation

public void incrementExpectation(int li,
                                 double value)

getScore

public double getScore(int li,
                       double[] parameters)

getProjectionValueContrib

public double getProjectionValueContrib(double[] parameters)

getCompleteValueContrib

public double getCompleteValueContrib()

getGradient

public void getGradient(double[] parameters,
                        double[] gradient)

getNumConstrainedLabels

public int getNumConstrainedLabels()