public class LogPrior
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
LogPrior.LogPriorType |
Constructor and Description |
---|
LogPrior() |
LogPrior(double[] C)
IMPORTANT NOTE: This constructor allows non-uniform regularization, but it
transforms the inputs C (like the machine learning people like) to sigma
(like we NLP folks like).
|
LogPrior(int intPrior) |
LogPrior(int intPrior,
double sigma,
double epsilon) |
LogPrior(LogPrior.LogPriorType type) |
LogPrior(LogPrior.LogPriorType type,
double sigma,
double epsilon) |
Modifier and Type | Method and Description |
---|---|
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
|
double |
computeStochastic(double[] x,
double[] grad,
double fractionOfData) |
static LogPrior |
getAdaptationPrior(double[] means,
LogPrior otherPrior) |
double |
getEpsilon() |
double |
getSigma() |
double |
getSigmaSquared() |
double[] |
getSigmaSquaredM() |
LogPrior.LogPriorType |
getType() |
static LogPrior.LogPriorType |
getType(java.lang.String name) |
void |
setEpsilon(double epsilon) |
void |
setSigma(double sigma) |
void |
setSigmaSquared(double sigmaSq) |
void |
setSigmaSquaredM(double[] sigmaSq) |
public LogPrior()
public LogPrior(int intPrior)
public LogPrior(LogPrior.LogPriorType type)
public LogPrior(int intPrior, double sigma, double epsilon)
public LogPrior(LogPrior.LogPriorType type, double sigma, double epsilon)
public LogPrior(double[] C)
public static LogPrior.LogPriorType getType(java.lang.String name)
public LogPrior.LogPriorType getType()
public double getSigma()
public double getSigmaSquared()
public double[] getSigmaSquaredM()
public double getEpsilon()
public void setSigma(double sigma)
public void setSigmaSquared(double sigmaSq)
public void setSigmaSquaredM(double[] sigmaSq)
public void setEpsilon(double epsilon)
public double computeStochastic(double[] x, double[] grad, double fractionOfData)
public double compute(double[] x, double[] grad)
x
- the input pointgrad
- the gradient array