Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.classifier.scoringFunctionBased.logPrior
Class LogPrior

    java.lang.Object
      de.jstacs.algorithms.optimization.DifferentiableFunction
          de.jstacs.classifier.scoringFunctionBased.logPrior.LogPrior

All Implemented Interfaces:
  Function, Storable

Direct Known Subclasses:
  DoesNothingLogPrior, SeparateLogPrior, SimpleGaussianSumLogPrior

    public abstract class LogPrior

extends DifferentiableFunction
implements Storable

The abstract class for any log-prior used e.g. for maximum supervised posterior optimization.

Author:
  Jens Keilwagen

Field Summary
`static int` | `UNKNOWN` Sometimes the method 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 function at a certain vector (in mathematical sense) `x`
`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, ScoringFunction... funs)` Resets all pre-computed values to their initial values using the `ScoringFunction`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

### UNKNOWN

    public static final int UNKNOWN

  Sometimes the method getDimensionOfScope() can not return a value. In these cases it is recommended to use this constant.

  See Also:
    Constant Field Values

Constructor Detail

### LogPrior

    public LogPrior()

Method Detail

### addGradientFor

    public abstract void addGradientFor(double[] params,
                                        double[] vector)
                                 throws EvaluationException

  Adds the gradient of the log-prior using the current parameters to a given vector.

  Parameters:
    `params` - the parameters
    `vector` - the vector
  Throws:
    `EvaluationException` - is thrown if the gradient could not be evaluated

### evaluateGradientOfFunction

    public final double[] evaluateGradientOfFunction(double[] params)
                                              throws EvaluationException

  Description copied from class: `DifferentiableFunction`
  Evaluates the gradient of function at a certain vector (in mathematical sense) `x`

  Specified by:
    `evaluateGradientOfFunction` in class `DifferentiableFunction`
  Parameters:
    `params` - the current vector
  Returns:
    the elvaluation of the gradient of a function; has dimension `getDimensionOfScope()`
  Throws:
    `EvaluationException` - if there was a mistake in evaluating the gradient
  See Also:
    `Function.getDimensionOfScope()`

### getNewInstance

    public abstract LogPrior getNewInstance()
                                     throws CloneNotSupportedException

  This method returns an empty new instance of the current prior. The method works similar to clone, but does not clone `ScoringFunction`s that may be inside the instance. The `ScoringFunction`s must be set by an invocation of the method `set(boolean, ScoringFunction...)`.

  Returns:
    a new empty instance of the prior
  Throws:
    `CloneNotSupportedException`
  See Also:
    `set(boolean, ScoringFunction[])`

### set

    public void set(boolean freeParameters,
                    ScoringFunction... funs)
             throws Exception

  Resets all pre-computed values to their initial values using the `ScoringFunction`s `funs`

  Parameters:
    `freeParameters` - if true, only the free parameters are used
    `funs` - the `ScoringFunction`s for the prior
  Throws:
    `Exception` - is thrown if the `ScoringFunction`s could not be set

### toXML

    public abstract StringBuffer toXML()

  Encodes the prior as an XML-representation. It does not encode all information, since the method `set` has to be invoked after decoding.

  Specified by:
    `toXML` in interface `Storable`
  Returns:
    the XML-representation;

### getInstanceName

    public abstract String getInstanceName()

  Returns a short instance name.

  Returns:
    a short instance name

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD