KernelFunction Class Reference

Definition of a kernel function as a ReClaM model. More...

#include <KernelFunction.h>

Inheritance diagram for KernelFunction:

Model DiagGaussKernel GeneralGaussKernel LinearKernel NormalizedKernel NormalizedRBFKernel PolynomialKernel RBFKernel WeightedSumKernel WeightedSumKernel2

List of all members.

Public Member Functions

 KernelFunction ()
 Constructor.
virtual ~KernelFunction ()
 Destructor.
virtual double eval (const Array< double > &x1, const Array< double > &x2) const =0
 Evaluates the kernel function on a const object.
virtual double evalDerivative (const Array< double > &x1, const Array< double > &x2, Array< double > &derivative) const
 Evaluates the kernel function and computes its derivatives w.r.t.
double operator() (const Array< double > &x1, const Array< double > &x2)
 Kernel evaluation in the form of an operator.
void model (const Array< double > &input, Array< double > &output)
 The Model behaviour of the KernelFunction is to interpret the input as a matrix of two vectors and to compute the kernel value on them.
void modelDerivative (const Array< double > &input, Array< double > &derivative)
 Same as model, additionally the derivatives w.r.t.
void modelDerivative (const Array< double > &input, Array< double > &output, Array< double > &derivative)
 Same as model, additionally the derivatives w.r.t.

Friends

class C_SVM


Detailed Description

Definition of a kernel function as a ReClaM model.

The interpretation of a kernel function as a ReClaM Model involves some complications. We have to cope with the problem that the Model usually produces one output per input, while the KernelFunction produces one output for a pair of inputs. Nevertheless, we want the KernelFunction to be a parameterized ReClaM Model for the sake of optimization. For simplicity, the input data are required to be matrices composed of exactly two columns for KernelFunction Models. For this reason, the KernelFunction provides an additional interface through its virtual members eval and evalDerivative that should be overriden. The inherited members model and modelDerivative redirect to this interface.

The modelDerivative member considerably differs from the standard behavior as it requires a two dimensional input array (holding two input patterns). Usually, only one input pattern is allowed for derivative computations. On the other hand, the derivative array is one dimensional, indexed only by the kernel parameters.

According to the differences between KernelFunction and Model it is advisable to use the eval and evalDerivative interface whenever it is clear that the object under consideration is a KernelFunction.

Definition at line 85 of file KernelFunction.h.


Constructor & Destructor Documentation

KernelFunction::KernelFunction (  ) 

Constructor.

Definition at line 52 of file KernelFunction.cpp.

KernelFunction::~KernelFunction (  )  [virtual]

Destructor.

Definition at line 56 of file KernelFunction.cpp.


Member Function Documentation

virtual double KernelFunction::eval ( const Array< double > &  x1,
const Array< double > &  x2 
) const [pure virtual]

double KernelFunction::evalDerivative ( const Array< double > &  x1,
const Array< double > &  x2,
Array< double > &  derivative 
) const [virtual]

void KernelFunction::model ( const Array< double > &  input,
Array< double > &  output 
) [virtual]

The Model behaviour of the KernelFunction is to interpret the input as a matrix of two vectors and to compute the kernel value on them.

Implements Model.

Definition at line 82 of file KernelFunction.cpp.

References eval().

void KernelFunction::modelDerivative ( const Array< double > &  input,
Array< double > &  output,
Array< double > &  derivative 
) [virtual]

Same as model, additionally the derivatives w.r.t.

all kernel parameters are computed.

Reimplemented from Model.

Definition at line 93 of file KernelFunction.cpp.

References evalDerivative().

void KernelFunction::modelDerivative ( const Array< double > &  input,
Array< double > &  derivative 
) [virtual]

Same as model, additionally the derivatives w.r.t.

all kernel parameters are computed.

Reimplemented from Model.

Definition at line 88 of file KernelFunction.cpp.

References evalDerivative().

double KernelFunction::operator() ( const Array< double > &  x1,
const Array< double > &  x2 
) [inline]

Kernel evaluation in the form of an operator.

Definition at line 103 of file KernelFunction.h.

References eval().


Friends And Related Function Documentation

friend class C_SVM [friend]

Definition at line 121 of file KernelFunction.h.


The documentation for this class was generated from the following files: