|
||||||||||
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.SeparateLogPrior
de.jstacs.classifier.scoringFunctionBased.logPrior.SeparateLaplaceLogPrior
public class SeparateLaplaceLogPrior
Class for a LogPrior
that defines a Laplace-prior on the parameters of a set of NormalizableScoringFunction
s and a set of class-parameters.
The scale hyper-parameters of the Laplace-prior are determined from a set of class-specific base variances and the class-variances, respectively.
The formula to determine the shape hyper-parameter b[i]
for a parameter i
from a variance v[i]
is
b[i] = Math.srt(v[i]/2)
.
The variances v[i]
for a parameter i
of a NormalizableScoringFunction
fun[j]
are determined from the base variance v[j]
as
v[i] = v[j]*funs[j].getSizeOfEventSpaceForRandomVariablesOfParameter(j)
.
The mean-parameters are set to 0 for the parameters
of the NormalizableScoringFunction
s and to the user-specified means for the class-parameters.
Field Summary |
---|
Fields inherited from class de.jstacs.classifier.scoringFunctionBased.logPrior.SeparateLogPrior |
---|
classMus, classVars, freeParameters, funs, vars |
Fields inherited from class de.jstacs.classifier.scoringFunctionBased.logPrior.LogPrior |
---|
UNKNOWN |
Constructor Summary | |
---|---|
SeparateLaplaceLogPrior(double[] vars,
double[] classVars,
double[] classMus)
Creates a new SeparateLaplaceLogPrior from a set of base variances vars , a set of class-variances classVars ,
and a set of class-means classMus . |
|
SeparateLaplaceLogPrior(StringBuffer xml)
Re-creates a SeparateLaplaceLogPrior from its XML-representation as returned by SeparateLogPrior.toXML() . |
Method Summary | |
---|---|
void |
addGradientFor(double[] params,
double[] vector)
Adds the gradient of the log-prior using the current parameters to a given vector. |
double |
evaluateFunction(double[] x)
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. |
protected void |
unset()
Resets all internally pre-computed values, e.g. the hyper-parameters for each parameter. |
Methods inherited from class de.jstacs.classifier.scoringFunctionBased.logPrior.SeparateLogPrior |
---|
getNewInstance, set, toXML |
Methods inherited from class de.jstacs.classifier.scoringFunctionBased.logPrior.LogPrior |
---|
evaluateGradientOfFunction |
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 SeparateLaplaceLogPrior(double[] vars, double[] classVars, double[] classMus)
SeparateLaplaceLogPrior
from a set of base variances vars
, a set of class-variances classVars
,
and a set of class-means classMus
.
vars
- the base variances for each classclassVars
- the class-variancesclassMus
- the class-meanspublic SeparateLaplaceLogPrior(StringBuffer xml) throws NonParsableException
SeparateLaplaceLogPrior
from its XML-representation as returned by SeparateLogPrior.toXML()
.
xml
- the XML-representation
NonParsableException
- is thrown if the XML-code could not be parsedMethod Detail |
---|
protected void unset()
SeparateLogPrior
unset
in class SeparateLogPrior
public void addGradientFor(double[] params, double[] vector)
LogPrior
addGradientFor
in class LogPrior
params
- the parametersvector
- the vectorpublic double evaluateFunction(double[] x) throws DimensionException, EvaluationException
Function
x
x
- the current vector
DimensionException
- if dim(x) != n, with f: R^n -> R
EvaluationException
- if there was a mistake in evaluating the functionpublic int getDimensionOfScope()
Function
public String getInstanceName()
LogPrior
getInstanceName
in class LogPrior
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |