Interface PRConstraint
-
- All Known Implementing Classes:
OneLabelL2IndPRConstraints
,OneLabelL2PRConstraints
public interface PRConstraint
Interface for PR constraint that considers either one or two states.- Author:
- Gregory Druck
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addExpectations(double[] expectations)
PRConstraint
copy()
This is used in multi-threading.double
getAuxiliaryValueContribution(double[] parameters)
double
getCompleteValueContribution(double[] parameters)
void
getExpectations(double[] expectations)
void
getGradient(double[] parameters, double[] gradient)
double
getScore(FeatureVector input, int inputPosition, int srcIndex, int destIndex, double[] parameters)
void
incrementExpectations(FeatureVector input, int inputPosition, int srcIndex, int destIndex, double prob)
int
numDimensions()
void
preProcess(FeatureVector input)
Gives the constraint the option to do some caching using only the FeatureVector.java.util.BitSet
preProcess(InstanceList data)
void
setStateLabelMap(StateLabelMap map)
Sets that map between the state indices and label indices.void
zeroExpectations()
Zero expectation values.
-
-
-
Method Detail
-
numDimensions
int numDimensions()
-
getScore
double getScore(FeatureVector input, int inputPosition, int srcIndex, int destIndex, double[] parameters)
-
incrementExpectations
void incrementExpectations(FeatureVector input, int inputPosition, int srcIndex, int destIndex, double prob)
-
getAuxiliaryValueContribution
double getAuxiliaryValueContribution(double[] parameters)
-
getCompleteValueContribution
double getCompleteValueContribution(double[] parameters)
-
getGradient
void getGradient(double[] parameters, double[] gradient)
-
setStateLabelMap
void setStateLabelMap(StateLabelMap map)
Sets that map between the state indices and label indices.- Parameters:
map
- StateLabelMap
-
zeroExpectations
void zeroExpectations()
Zero expectation values. Called before re-computing gradient.
-
preProcess
java.util.BitSet preProcess(InstanceList data)
- Parameters:
data
- Unlabeled data- Returns:
- Returns a bitset of the size of the data, with the bit set if a constraint feature fires in that instance.
-
preProcess
void preProcess(FeatureVector input)
Gives the constraint the option to do some caching using only the FeatureVector. For example, the constrained input features could be cached.- Parameters:
input
- FeatureVector input
-
copy
PRConstraint copy()
This is used in multi-threading.- Returns:
- A copy of the GEConstraint.
-
getExpectations
void getExpectations(double[] expectations)
-
addExpectations
void addExpectations(double[] expectations)
-
-