|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.algorithms.optimization.DifferentiableFunction
de.jstacs.classifiers.differentiableSequenceScoreBased.logPrior.LogPrior
de.jstacs.classifiers.differentiableSequenceScoreBased.logPrior.SeparateLogPrior
de.jstacs.classifiers.differentiableSequenceScoreBased.logPrior.SeparateGaussianLogPrior
public class SeparateGaussianLogPrior
Class for a LogPrior
that defines a Gaussian prior on the parameters
of a set of DifferentiableStatisticalModel
s
and a set of class parameters. The variances v[i]
for a
parameter i
of a
DifferentiableStatisticalModel
fun[j]
are determined from the base variance v[j]
as
v[i] = v[j]*funs[j].getSizeOfEventSpaceForRandomVariablesOfParameter(j)
.
The variances for the class parameters are used as defined by the user. The
mean parameters are set to 0 for the parameters of the
DifferentiableStatisticalModel
s and to the
user-specified means for the class parameters.
Field Summary |
---|
Fields inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.logPrior.SeparateLogPrior |
---|
classMus, classVars, freeParameters, funs, vars |
Fields inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.logPrior.LogPrior |
---|
UNKNOWN |
Constructor Summary | |
---|---|
SeparateGaussianLogPrior(double[] vars,
double[] classVars,
double[] classMus)
Creates a new SeparateGaussianLogPrior from a set of base
variances vars , a set of class variances
classVars and a set of class means classMus . |
|
SeparateGaussianLogPrior(StringBuffer xml)
The standard constructor for the interface Storable . |
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[] 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. |
void |
unset()
Resets all internally pre-computed values, e.g. the hyperparameters for each parameter. |
Methods inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.logPrior.SeparateLogPrior |
---|
getNewInstance, set, toXML |
Methods inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.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 SeparateGaussianLogPrior(double[] vars, double[] classVars, double[] classMus)
SeparateGaussianLogPrior
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 meansSeparateLogPrior.SeparateLogPrior(double[], double[], double[])
public SeparateGaussianLogPrior(StringBuffer xml) throws NonParsableException
Storable
.
Creates a new SeparateGaussianLogPrior
out of its XML
representation.
xml
- the XML representation as StringBuffer
NonParsableException
- if the SeparateGaussianLogPrior
could not be
reconstructed out of the XML representation (the
StringBuffer
could not be parsed)SeparateLogPrior.SeparateLogPrior(StringBuffer)
,
Storable
Method Detail |
---|
public void unset()
SeparateLogPrior
unset
in class SeparateLogPrior
public void addGradientFor(double[] params, double[] grad)
LogPrior
addGradientFor
in class LogPrior
params
- the parametersgrad
- the vectorpublic double evaluateFunction(double[] x) throws DimensionException, EvaluationException
Function
x
.
x
- the current vector
DimensionException
- if dim(x) != n
, with EvaluationException
- if there was something wrong during the evaluation of the
functionpublic int getDimensionOfScope()
Function
Function
.
n
with
public String getInstanceName()
LogPrior
getInstanceName
in class LogPrior
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |