|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.algorithms.optimization.DifferentiableFunction
de.jstacs.classifier.scoringFunctionBased.logPrior.LogPrior
de.jstacs.classifier.scoringFunctionBased.logPrior.SimpleGaussianSumLogPrior
public class SimpleGaussianSumLogPrior
This class implements a prior that is a product of Gaussian distributions with mean 0 and equal variance for each parameter.
Field Summary |
---|
Fields inherited from class de.jstacs.classifier.scoringFunctionBased.logPrior.LogPrior |
---|
UNKNOWN |
Constructor Summary | |
---|---|
SimpleGaussianSumLogPrior(double sigma)
Creates a new SimpleGaussianSumLogPrior with mean 0 and variance sigma for all parameters, including the class parameters. |
|
SimpleGaussianSumLogPrior(StringBuffer xml)
Re-creates a SimpleGaussianSumLogPrior from its XML-representation as returned by toXML() . |
Method Summary | |
---|---|
void |
addGradientFor(double[] params,
double[] grad)
Adds the gradient of the log-prior using the current parameters to a given vector. |
double |
evaluateFunction(double[] params)
Evaluates the function at a certain vector (in mathematical sense) x |
int |
getDimensionOfScope()
Returns the dimension of the scope of the function. |
String |
getInstanceName()
Returns a short instance name. |
SimpleGaussianSumLogPrior |
getNewInstance()
This method returns an empty new instance of the current prior. |
StringBuffer |
toXML()
Encodes the prior as an XML-representation. |
Methods inherited from class de.jstacs.classifier.scoringFunctionBased.logPrior.LogPrior |
---|
evaluateGradientOfFunction, set |
Methods inherited from class de.jstacs.algorithms.optimization.DifferentiableFunction |
---|
findOneDimensionalMin |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleGaussianSumLogPrior(double sigma)
SimpleGaussianSumLogPrior
with mean 0 and variance sigma
for all parameters, including the class parameters.
sigma
- the variancepublic SimpleGaussianSumLogPrior(StringBuffer xml) throws NonParsableException
SimpleGaussianSumLogPrior
from its XML-representation as returned by toXML()
.
xml
- the XML-representation
NonParsableException
- is thrown if the XML-code could not be parsedMethod Detail |
---|
public void addGradientFor(double[] params, double[] grad)
LogPrior
addGradientFor
in class LogPrior
params
- the parametersgrad
- the vectorpublic double evaluateFunction(double[] params)
Function
x
params
- the current vector
public int getDimensionOfScope()
Function
public SimpleGaussianSumLogPrior getNewInstance() throws CloneNotSupportedException
LogPrior
ScoringFunction
s that may be inside the instance. The ScoringFunction
s must be set by an invocation of the method LogPrior.set(boolean, ScoringFunction...)
.
getNewInstance
in class LogPrior
CloneNotSupportedException
LogPrior.set(boolean, ScoringFunction[])
public StringBuffer toXML()
LogPrior
set
has to be invoked after decoding.
toXML
in interface Storable
toXML
in class LogPrior
public String getInstanceName()
LogPrior
getInstanceName
in class LogPrior
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |