edu.stanford.nlp.ie.crf
Class CRFLogConditionalObjectiveFunctionForLOP

java.lang.Object
  extended by edu.stanford.nlp.optimization.AbstractCachingDiffFunction
      extended by edu.stanford.nlp.ie.crf.CRFLogConditionalObjectiveFunctionForLOP
All Implemented Interfaces:
HasCliquePotentialFunction, DiffFunction, Function, HasInitial

public class CRFLogConditionalObjectiveFunctionForLOP
extends AbstractCachingDiffFunction
implements HasCliquePotentialFunction

Author:
Mengqiu Wang TODO(mengqiu) currently only works with disjoint feature sets for non-disjoint feature sets, need to recompute EHat each iteration, and multiply in the scale in EHat and E calculations for each lopExpert

Field Summary
static boolean VERBOSE
           
 
Fields inherited from class edu.stanford.nlp.optimization.AbstractCachingDiffFunction
derivative, value
 
Method Summary
 void calculate(double[] x)
          Calculates both value and partial derivatives at the point x, and save them internally.
static double[] combineAndScaleLopWeights(int numLopExpert, double[][] lopExpertWeights, double[] lopScales)
           
static double[][] combineAndScaleLopWeights2D(int numLopExpert, double[][][] lopExpertWeights2D, double[] lopScales)
           
 int domainDimension()
          Returns the number of dimensions in the function's domain
 double[][][] empty2D()
           
 CliquePotentialFunction getCliquePotentialFunction(double[] x)
           
 double[] initial()
          Returns the intitial point in the domain (but not necessarily a feasible one).
 double[][] separateLopExpertWeights(double[] learnedParams)
           
 double[][][] separateLopExpertWeights2D(double[] learnedParams)
           
 double[] separateLopScales(double[] learnedParams)
           
 
Methods inherited from class edu.stanford.nlp.optimization.AbstractCachingDiffFunction
clearCache, copy, derivativeAt, gradientCheck, gradientCheck, lastValue, randomInitial, valueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

public static boolean VERBOSE
Method Detail

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
Returns:
the number of domain dimensions

initial

public double[] initial()
Description copied from interface: HasInitial
Returns the intitial point in the domain (but not necessarily a feasible one).

Specified by:
initial in interface HasInitial
Overrides:
initial in class AbstractCachingDiffFunction
Returns:
a domain point

empty2D

public double[][][] empty2D()

combineAndScaleLopWeights

public static double[] combineAndScaleLopWeights(int numLopExpert,
                                                 double[][] lopExpertWeights,
                                                 double[] lopScales)

combineAndScaleLopWeights2D

public static double[][] combineAndScaleLopWeights2D(int numLopExpert,
                                                     double[][][] lopExpertWeights2D,
                                                     double[] lopScales)

separateLopExpertWeights2D

public double[][][] separateLopExpertWeights2D(double[] learnedParams)

separateLopExpertWeights

public double[][] separateLopExpertWeights(double[] learnedParams)

separateLopScales

public double[] separateLopScales(double[] learnedParams)

getCliquePotentialFunction

public CliquePotentialFunction getCliquePotentialFunction(double[] x)
Specified by:
getCliquePotentialFunction in interface HasCliquePotentialFunction

calculate

public void calculate(double[] x)
Calculates both value and partial derivatives at the point x, and save them internally.

Specified by:
calculate in class AbstractCachingDiffFunction
Parameters:
x - The point at which to calculate the function


Stanford NLP Group