Class OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint
- java.lang.Object
-
- cc.mallet.fst.semi_supervised.pr.constraints.OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint
-
- Enclosing class:
- OneLabelL2IndPRConstraints
protected class OneLabelL2IndPRConstraints.OneLabelL2IndPRConstraint extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description OneLabelL2IndPRConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
-
-
-
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
-
-
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()
-
-