Package 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 for GE in CRFs. This code, however, is just for log-linear model 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)
-
-
Field Summary
-
Fields inherited from class edu.stanford.nlp.optimization.AbstractCachingDiffFunction
derivative, value
-
-
Constructor Summary
Constructors Constructor Description GeneralizedExpectationObjectiveFunction(GeneralDataset<L,F> labeledDataset, List<? extends Datum<L,F>> unlabeledDataList, List<F> geFeatures)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcalculate(double[] x)Calculate the value at x and the derivative and save them in the respective fields.intdomainDimension()Returns the number of dimensions in the function's domainprotected intindexOf(int f, int c)double[][]to2D(double[] x)-
Methods inherited from class edu.stanford.nlp.optimization.AbstractCachingDiffFunction
clearCache, copy, derivativeAt, ensure, getDerivative, gradientCheck, gradientCheck, initial, lastValue, randomInitial, valueAt
-
-
-
-
Method Detail
-
domainDimension
public int domainDimension()
Description copied from interface:FunctionReturns the number of dimensions in the function's domain- 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:AbstractCachingDiffFunctionCalculate the value at x and the derivative and save them in the respective fields.- Specified by:
calculatein classAbstractCachingDiffFunction- Parameters:
x- The point at which to calculate the function
-
-