|
||||||||||
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
public abstract class SeparateLogPrior
Abstract class for priors that penalize each parameter value independently and have some variance (and possible mean) as
hyper-parameters. Such priors are e.g. the SeparateGaussianLogPrior
or the SeparateLaplaceLogPrior
.
Field Summary | |
---|---|
protected double[] |
classMus
The means for the class parameters, as specified by the user |
protected double[] |
classVars
The variances for the class parameters, as specified by the user |
protected boolean |
freeParameters
indicates, if only free parameters shall be used and hence penalized |
protected NormalizableScoringFunction[] |
funs
The ScoringFunction s using the parameters that shall be penalized |
protected double[] |
vars
The base variances for the parameters of the ScoringFunction s of each class, the means of the non-class parameters should be 0. |
Fields inherited from class de.jstacs.classifier.scoringFunctionBased.logPrior.LogPrior |
---|
UNKNOWN |
Constructor Summary | |
---|---|
SeparateLogPrior(double[] vars,
double[] classVars,
double[] classMus)
Creates a new SeparateLogPrior using the class-specific base variances vars ,
the variances classVars and the means classMus
for the class parameters. |
|
SeparateLogPrior(StringBuffer xml)
Re-creates a SeparateLogPrior from its XML-representation as returned by toXML() . |
Method Summary | |
---|---|
SeparateLogPrior |
getNewInstance()
This method returns an empty new instance of the current prior. |
void |
set(boolean freeParameters,
ScoringFunction... funs)
Resets all pre-computed values to their initial values using the ScoringFunction s funs |
StringBuffer |
toXML()
Encodes the prior as an XML-representation. |
protected abstract 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.LogPrior |
---|
addGradientFor, evaluateGradientOfFunction, getInstanceName |
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 |
Methods inherited from interface de.jstacs.algorithms.optimization.Function |
---|
evaluateFunction, getDimensionOfScope |
Field Detail |
---|
protected NormalizableScoringFunction[] funs
ScoringFunction
s using the parameters that shall be penalized
protected double[] vars
ScoringFunction
s of each class, the means of the non-class parameters should be 0.
protected double[] classVars
protected double[] classMus
protected boolean freeParameters
Constructor Detail |
---|
public SeparateLogPrior(double[] vars, double[] classVars, double[] classMus)
SeparateLogPrior
using the class-specific base variances vars
,
the variances classVars
and the means classMus
for the class parameters.
vars
- the base variances for each classclassVars
- the variances for the class parametersclassMus
- the means for the class parameterspublic SeparateLogPrior(StringBuffer xml) throws NonParsableException
SeparateLogPrior
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 set(boolean freeParameters, ScoringFunction... funs) throws Exception
LogPrior
ScoringFunction
s funs
set
in class LogPrior
freeParameters
- if true, only the free parameters are usedfuns
- the ScoringFunction
s for the prior
Exception
- is thrown if the ScoringFunction
s could not be setprotected abstract void unset()
public SeparateLogPrior 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |