edu.stanford.nlp.classify
Class LogPrior

java.lang.Object
  extended by edu.stanford.nlp.classify.LogPrior
All Implemented Interfaces:
Serializable

public class LogPrior
extends Object
implements Serializable

A Prior for functions. Immutable.

Author:
Galen Andrew
See Also:
Serialized Form

Nested Class Summary
static class LogPrior.LogPriorType
           
 
Constructor Summary
LogPrior()
           
LogPrior(int intPrior)
           
LogPrior(int intPrior, double sigma, double epsilon)
           
LogPrior(LogPrior.LogPriorType type)
           
LogPrior(LogPrior.LogPriorType type, double sigma, double epsilon)
           
 
Method Summary
 double compute(double[] x, double[] grad)
          Adjust the given grad array by adding the prior's gradient component and return the value of the logPrior
static LogPrior getAdaptationPrior(double[] means, LogPrior otherPrior)
           
 double getEpsilon()
           
 double getSigma()
           
 LogPrior.LogPriorType getType()
           
static LogPrior.LogPriorType getType(String name)
           
 void setEpsilon(double epsilon)
           
 void setSigma(double sigma)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogPrior

public LogPrior()

LogPrior

public LogPrior(int intPrior)

LogPrior

public LogPrior(LogPrior.LogPriorType type)

LogPrior

public LogPrior(int intPrior,
                double sigma,
                double epsilon)

LogPrior

public LogPrior(LogPrior.LogPriorType type,
                double sigma,
                double epsilon)
Method Detail

getType

public static LogPrior.LogPriorType getType(String name)

getAdaptationPrior

public static LogPrior getAdaptationPrior(double[] means,
                                          LogPrior otherPrior)

getType

public LogPrior.LogPriorType getType()

getSigma

public double getSigma()

getEpsilon

public double getEpsilon()

setSigma

public void setSigma(double sigma)

setEpsilon

public void setEpsilon(double epsilon)

compute

public double compute(double[] x,
                      double[] grad)
Adjust the given grad array by adding the prior's gradient component and return the value of the logPrior

Parameters:
x - the input point
grad - the gradient array
Returns:
the value


Stanford NLP Group