|
||||||||||
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
public abstract class LogPrior
The abstract class for any log-prior used e.g. for maximum supervised posterior optimization.
Field Summary | |
---|---|
static int |
UNKNOWN
Sometimes the method Function.getDimensionOfScope()
can not return a value. |
Constructor Summary | |
---|---|
LogPrior()
|
Method Summary | |
---|---|
abstract void |
addGradientFor(double[] params,
double[] vector)
Adds the gradient of the log-prior using the current parameters to a given vector. |
double[] |
evaluateGradientOfFunction(double[] params)
Evaluates the gradient of a function at a certain vector (in mathematical sense) x , i.e.,
![]() |
abstract String |
getInstanceName()
Returns a short instance name. |
abstract LogPrior |
getNewInstance()
This method returns an empty new instance of the current prior. |
void |
set(boolean freeParameters,
DifferentiableSequenceScore... funs)
Resets all pre-computed values to their initial values using the DifferentiableSequenceScore s funs . |
abstract StringBuffer |
toXML()
Encodes the prior as an XML representation. |
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 |
---|
public static final int UNKNOWN
Function.getDimensionOfScope()
can not return a value. In these cases it is recommended to use this
constant.
Constructor Detail |
---|
public LogPrior()
Method Detail |
---|
public abstract void addGradientFor(double[] params, double[] vector) throws EvaluationException
params
- the parametersvector
- the vector
EvaluationException
- if the gradient could not be evaluatedpublic final double[] evaluateGradientOfFunction(double[] params) throws EvaluationException
DifferentiableFunction
x
, i.e.,
evaluateGradientOfFunction
in class DifferentiableFunction
params
- the current vector
Function.getDimensionOfScope()
EvaluationException
- if there was something wrong during the evaluation of the
gradientFunction.getDimensionOfScope()
public abstract LogPrior getNewInstance() throws CloneNotSupportedException
DifferentiableSequenceScore
s that may be inside the instance. The DifferentiableSequenceScore
s must be
set by an invocation of the method
set(boolean, DifferentiableSequenceScore...)
.
CloneNotSupportedException
- if something went wrong while cloningset(boolean, DifferentiableSequenceScore...)
public void set(boolean freeParameters, DifferentiableSequenceScore... funs) throws Exception
DifferentiableSequenceScore
s funs
.
freeParameters
- the switch for using only the free parameters or all
parameters in a DifferentiableSequenceScore
funs
- the DifferentiableSequenceScore
s for the prior
Exception
- if the DifferentiableSequenceScore
s could not be setpublic abstract StringBuffer toXML()
set(boolean, DifferentiableSequenceScore...)
has to be invoked after decoding.
toXML
in interface Storable
public abstract String getInstanceName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |