KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kernels.GaussKernel Class Reference

Radial Basis Function Kernel. More...

Detailed Description

Radial Basis Function Kernel.

Uses the notation

\[\K(x,y) = e^{\frac{||x-y||^2}{\gamma^2}},\]

so be careful with the \(\gamma\) constant.

Author
Daniel Wirtz
Date
11.03.2011
Change in 0.5:
(Daniel Wirtz, 2011-10-16) Exported the evaluate function to kernels.ARBFKernel, but re-implemented the customized evaluate function as the norm squared is already computed fast and first taking the square root and then squaring again would introduce unecessary overhead.
Change in 0.3:
(Daniel Wirtz, 2011-04-26) Fixed the x0 computation for the new Gamma property version; so far a square was missing, rendering the LipschitzEstimator modified newton method useless.
Change in 0.3:
(Daniel Wirtz, 2011-04-15) Changed the Gamma property to compute into the kernel evaluation being squared instead of linear. This way the Gamma becomes a more geometrical meaning
Change in 0.2:
(Daniel Wirtz, 2011-03-11) Added new speed tests for one and two argument calls to evaluate. The tests are run iter times and the mean value is plotted to the output.

Definition at line 18 of file GaussKernel.m.

Public Member Functions

 GaussKernel (double Gamma)
 Creates a new GaussKernel. More...
 
function K = evaluate (matrix< double > x,matrix< double > y)
 Evaluates the gaussian. More...
 
function Nablax = getNabla (colvec< double > x,matrix< double > y)
 Method for first derivative evaluation. More...
 
function dx = evaluateD1 (r)
 Method for first derivative evaluation. More...
 
function ddx = evaluateD2 (r)
 Method for second derivative evaluation. More...
 
function phi = evaluateScalar (r)
 Implements the required method from the IRotationInvariant interface. More...
 
function g = setGammaForDistance (dist, ep)
 Computes the \(\gamma\) value for which the Gaussian is smaller than \(\epsilon\) in a distance of dist, i.e.

\[e^{-\frac{d^2}{\gamma}} < \epsilon\]

Returns the computed value AND sets the kernel's Gamma property to this value. More...

 
function copy = clone ()
 
- Public Member Functions inherited from kernels.BellFunction
 BellFunction ()
 
function c = getGlobalLipschitz ()
 Computes the absolute value of the first derivative at x0 Implements the template method from BaseKernel. More...
 
function copy = clone (copy)
 The interface method with returns a copy of the current class instance. More...
 
function rtmp = ModifiedNewton (rstart, s)
 
virtual function dr = evaluateD1 ()
 Method for first derivative evaluation. More...
 
virtual function ddr = evaluateD2 ()
 Method for second derivative evaluation. More...
 
- Public Member Functions inherited from kernels.ARBFKernel
 ARBFKernel ()
 
function K = evaluate (matrix< double > x,matrix< double > y)
 Evaluates the rotation and translation invariant kernel. More...
 
function bool = eq (B)
 
function r = getSqDiffNorm (matrix< double > x,matrix< double > y)
 Returns the weighted squared norm \(r\) of the difference \(\noG{x-y}^2/\gamma^2\). More...
 
virtual function phir = evaluateScalar (matrix< double > r)
 Allows the evaluation of the function \(\phi(r)\) for scalar \(r\) directly. More...
 
- Public Member Functions inherited from kernels.BaseKernel
 BaseKernel ()
 
function fcn = getLipschitzFunction ()
 Method that allows error estimators to obtain a lipschitz constant estimation function from this kernel. More...
 
function bool = eq (B)
 Checks if a kernel equals another kernel. More...
 
virtual function Nabla = getNabla (x, y)
 Computes the partial derivatives with respect to each component of the first argument. More...
 
- Public Member Functions inherited from KerMorObject
 KerMorObject ()
 Constructs a new KerMor object. More...
 
function  display ()
 disp(object2str(this)); More...
 
function bool = eq (B)
 Checks equality of two KerMor objects. More...
 
function bool = ne (B)
 Checks if two KerMorObjects are different. More...
 
function cn = getClassName ()
 Returns the simple class name of this object without packages. More...
 
- Public Member Functions inherited from DPCMObject
 DPCMObject ()
 Creates a new DPCM object. More...
 
 DPCMObject ()
 

Static Public Member Functions

static function res = test_InterpolGamma ()
 
static function [
res ,
pm ] = 
test_GaussKernel (pm)
 

Static Protected Member Functions

static function obj = loadobj (obj)
 
- Static Protected Member Functions inherited from kernels.BellFunction
static function this = loadobj (this, from)
 As the constant properties are transient, they have to be re-computed upon loading. More...
 
- Static Protected Member Functions inherited from DPCMObject
static function obj = loadobj (obj, from)
 Re-register any registered change listeners! More...
 
static function obj = loadobj (obj, from)
 

Additional Inherited Members

- Public Attributes inherited from kernels.BellFunction
 r0
 Point of maximum first derivative on scalar evaluation. More...
 
 NewtonTolerance = 1e-7
 Error tolerance for modified newton iteration. More...
 
 MaxNewtonIterations = 5000
 Hard break for iteration count of modified newton algorithm. More...
 
 rm
 The maximum ("right") value for any \(r_s\). More...
 
- Public Attributes inherited from kernels.ARBFKernel
double Gamma = 1
 Univariate scaling. More...
 
- Public Attributes inherited from kernels.BaseKernel
matrix< doubleG = 1
 The matrix \(\vG\) that induces the state space scalar product \(\spG{x}{y}\) and norm \(\noG{x-y}\) to use. More...
 
matrix< doubleP = "[]"
 Projection/selection matrix \(\vP\) for argument components. More...
 
logical IsRBF = false
 Flag that determines if the current kernel is a radial basis function, i.e. its evaluation is of the form \(\K(x,y) = \phi(\noG{x-y})\) for some scalar function \(\phi\). More...
 
logical IsScProd = false
 Flag that determines if the current kernel bases on scalar product evaluations, i.e. are of the form \(\K(x,y) = \phi(\spG{x}{y})\) for some scalar function \(\phi\). More...
 
- Public Attributes inherited from DPCMObject
 WorkspaceVariableName = ""
 The workspace variable name of this class. Optional. More...
 
 ID = "[]"
 An ID that allows to uniquely identify this DPCMObject (at least within the current MatLab session/context). More...
 
 PropertiesChanged = "[]"
 The Dictionary containing all the property settings as key/value pairs. More...
 
- Public Attributes inherited from handle
 addlistener
 Creates a listener for the specified event and assigns a callback function to execute when the event occurs. More...
 
 notify
 Broadcast a notice that a specific event is occurring on a specified handle object or array of handle objects. More...
 
 delete
 Handle object destructor method that is called when the object's lifecycle ends. More...
 
 disp
 Handle object disp method which is called by the display method. See the MATLAB disp function. More...
 
 display
 Handle object display method called when MATLAB software interprets an expression returning a handle object that is not terminated by a semicolon. See the MATLAB display function. More...
 
 findobj
 Finds objects matching the specified conditions from the input array of handle objects. More...
 
 findprop
 Returns a meta.property objects associated with the specified property name. More...
 
 fields
 Returns a cell array of string containing the names of public properties. More...
 
 fieldnames
 Returns a cell array of string containing the names of public properties. See the MATLAB fieldnames function. More...
 
 isvalid
 Returns a logical array in which elements are true if the corresponding elements in the input array are valid handles. This method is Sealed so you cannot override it in a handle subclass. More...
 
 eq
 Relational functions example. See details for more information. More...
 
 transpose
 Transposes the elements of the handle object array. More...
 
 permute
 Rearranges the dimensions of the handle object array. See the MATLAB permute function. More...
 
 reshape
 hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape function. More...
 
 sort
 ort the handle objects in any array in ascending or descending order. More...
 
- Protected Member Functions inherited from kernels.BellFunction
function [ g ,
dg ,
pi ,
pl ,
pr ] = 
optFun (r, s, n, dn)
 
- Protected Member Functions inherited from KerMorObject
function  checkType (obj, type)
 Object typechecker. More...
 
- Protected Member Functions inherited from DPCMObject
function  registerProps (varargin)
 Call this method at any class that defines DPCM observed properties. More...
 
function  registerProps (varargin)
 
- Protected Attributes inherited from kernels.BaseKernel
 fG = 1
 
 fP = "[]"
 

Constructor & Destructor Documentation

kernels.GaussKernel.GaussKernel ( double  Gamma)

Creates a new GaussKernel.

Parameters
GammaThe Gamma property to use. Default: 1

Definition at line 50 of file GaussKernel.m.

References handle.addlistener, kernels.ARBFKernel.Gamma, and DPCMObject.registerProps().

Here is the call graph for this function:

Member Function Documentation

function copy = kernels.GaussKernel.clone ( )

Definition at line 177 of file GaussKernel.m.

References kernels.ARBFKernel.Gamma.

function K = kernels.GaussKernel.evaluate ( matrix< double x,
matrix< double y 
)
virtual

Evaluates the gaussian.

If \(y_j\) is set, the dimensions of \(x_i\) and \(y_j\) must be equal for all \(i,j\).

Parameters
xFirst set \(x_i \in \R^d\) of \(n\) vectors
ySecond set \(y_j \in \R^d\) of \(m\) vectors. If y is empty \(y_i = x_i\) and \(n=m\) is assumed.
Return values
KAn evaluation matrix \(K \in \R^{n\times m}\) of the evaluated gaussians with entries \(K_{i,j} = e^{-\norm{x_i-y_j}{G}^2/\gamma^2}\).

Implements kernels.BaseKernel.

Definition at line 69 of file GaussKernel.m.

References kernels.ARBFKernel.Gamma, and kernels.ARBFKernel.getSqDiffNorm().

Referenced by getNabla().

Here is the call graph for this function:

Here is the caller graph for this function:

function dx = kernels.GaussKernel.evaluateD1 (   r)

Method for first derivative evaluation.

Definition at line 115 of file GaussKernel.m.

References kernels.ARBFKernel.Gamma.

function ddx = kernels.GaussKernel.evaluateD2 (   r)

Method for second derivative evaluation.

Definition at line 126 of file GaussKernel.m.

References kernels.ARBFKernel.Gamma.

function phi = kernels.GaussKernel.evaluateScalar (   r)

Implements the required method from the IRotationInvariant interface.

Definition at line 137 of file GaussKernel.m.

function Nablax = kernels.GaussKernel.getNabla ( colvec< double x,
matrix< double y 
)

Method for first derivative evaluation.

Parameters
xThe state variable vector \(\vx(t)\)
yThe output variable vector \(\vy(t) = \vC(t,\vmu)\vx(t),~t=0\ldots T\) (general notation)

Definition at line 88 of file GaussKernel.m.

References evaluate(), kernels.BaseKernel.fP, and kernels.ARBFKernel.Gamma.

Here is the call graph for this function:

static function obj = kernels.GaussKernel.loadobj (   obj)
staticprotected

Definition at line 200 of file GaussKernel.m.

function g = kernels.GaussKernel.setGammaForDistance (   dist,
  ep 
)

Computes the \(\gamma\) value for which the Gaussian is smaller than \(\epsilon\) in a distance of dist, i.e.

\[e^{-\frac{d^2}{\gamma}} < \epsilon\]

Returns the computed value AND sets the kernel's Gamma property to this value.

Parameters
distThe target distance at which the gaussian is smaller than ep
epThe \(\epsilon\) value. If not given, \(\epsilon\)=eps (machine precision) is assumed.
Return values
gThe computed gamma

Definition at line 149 of file GaussKernel.m.

References KerMor.App(), and kernels.ARBFKernel.Gamma.

Here is the call graph for this function:

static function [res , pm ] = kernels.GaussKernel.test_GaussKernel (   pm)
static

Definition at line 255 of file GaussKernel.m.

References k, handle.reshape, X, and Y.

static function res = kernels.GaussKernel.test_InterpolGamma ( )
static

Definition at line 215 of file GaussKernel.m.

References handle.disp, and k.


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