edu.stanford.nlp.classify
Class GeneralizedExpectationObjectiveFunction<L,F>
java.lang.Object
edu.stanford.nlp.optimization.AbstractCachingDiffFunction
edu.stanford.nlp.classify.GeneralizedExpectationObjectiveFunction<L,F>
- All Implemented Interfaces:
- DiffFunction, Function, HasInitial
public class GeneralizedExpectationObjectiveFunction<L,F>
- extends AbstractCachingDiffFunction
Implementation of Generalized Expectation Objective function for an I.I.D. log-linear model. See Mann and McCallum, ACL 2008.
IMPORTANT : the current implementation is only correct as long as the labeled features passed to GE are binary.
However, other features are allowed to be real valued.
The original paper also discusses GE only for binary features.
- Author:
- Ramesh Nallapati (nmramesh@cs.stanford.edu)
Method Summary |
protected void |
calculate(double[] x)
Calculate the value at x and the derivative and save them in the respective fields |
int |
domainDimension()
Returns the number of dimensions in the function's domain |
protected int |
indexOf(int f,
int c)
|
double[][] |
to2D(double[] x)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
numFeatures
protected int numFeatures
numClasses
protected int numClasses
GeneralizedExpectationObjectiveFunction
public GeneralizedExpectationObjectiveFunction(GeneralDataset<L,F> labeledDataset,
List<? extends Datum<L,F>> unlabeledDataList,
List<F> geFeatures)
domainDimension
public int domainDimension()
- Description copied from interface:
Function
- Returns the number of dimensions in the function's domain
- Specified by:
domainDimension
in interface Function
- Specified by:
domainDimension
in class AbstractCachingDiffFunction
- Returns:
- the number of domain dimensions
indexOf
protected int indexOf(int f,
int c)
to2D
public double[][] to2D(double[] x)
calculate
protected void calculate(double[] x)
- Description copied from class:
AbstractCachingDiffFunction
- Calculate the value at x and the derivative and save them in the respective fields
- Specified by:
calculate
in class AbstractCachingDiffFunction
Stanford NLP Group