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
approx.algorithms.AAdaptiveBase Class Referenceabstract

Base class for adaptive component-wise kernel approximation algorithms. More...

Detailed Description

Base class for adaptive component-wise kernel approximation algorithms.

Author
Daniel Wirtz
Date
2011-11-02
New in 0.6:
(Daniel Wirtz, 2012-01-26) Added a new approximation stallment detection. The properties MinImprovePerc and ImproveRange control at which stage the approximation is to be stopped if no sufficient progress in approximation error is made.
New in 0.5:
(Daniel Wirtz, 2011-11-02)
  • Created this class. Collects common properties of the adaptive approx algorithms and provides convenience methods for subclasses.
  • New interface for approximation computation: Passing an data.ApproxTrainData instance now instead of xi,ti,mui parameters.
See Also
BaseApprox KernelApprox approx.algorithms.ABase

This class is part of the framework

KerMor - Model Order Reduction using Kernels

Definition at line 19 of file AAdaptiveBase.m.

Public Member Functions

 AAdaptiveBase ()
 
function copy = clone (copy)
 Clones the instance. More...
 
- Public Member Functions inherited from approx.algorithms.ABase
 ABase ()
 
function copy = clone (copy)
 The interface method with returns a copy of the current class instance. More...
 
function kernels.KernelExpansion
kexp = 
computeApproximation (data.ApproxTrainData atd, avd)
 
function [ str ,

rangetab ] = 
getApproximationSummary ()
 Setup. More...
 
function  plotSummary (pm, context)
 
function nc = getTotalNumConfigurations ()
 
- 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 ()
 

Public Attributes

integer MaxExpansionSize = 300
 The maximum size of the expansion to produce. More...
 
double MaxRelErr = 1e-5
 Stopping condition property. Maximum relative error that may occur. More...
 
char InitialCenter = "maxfx"
 Determines how the initial center(s) are chosen. More...
 
colvec< doubleExpansionSizes
 
 Used = "[]"
 The indices of the effectively used centers during the. More...
 
- Public Attributes inherited from approx.algorithms.ABase
kernels.config.ExpansionConfig ExpConfig = "[]"
 The different kernel expansion configurations to try. More...
 
 UsefScaling = false
 Flag that determines whether the approximation center f values should be scaled to [-1,1] before the approximation is computed. More...
 
function_handle ErrorFun = @Norm.L2
 The error function to apply on each data vector. More...
 
double LastCompTime = "[]"
 The computation time for the last run in seconds. More...
 
matrix< doubleMaxErrors = "[]"
 For each configuration, contains a row with the maximum errors on the training data. The number of columns depends on the type of algorithm implemented by the subclasses. More...
 
matrix< doubleMaxRelErrors = "[]"
 For each configuration, contains a row with the maximum relative errors on the training data. The number of columns depends on the type of algorithm implemented by the subclasses. More...
 
matrix< doubleValidationErrors = "[]"
 For each configuration, contains a row with the maximum errors on the validation data. The number of columns depends on the type of algorithm implemented by the subclasses. More...
 
matrix< doubleValidationRelErrors = "[]"
 For each configuration, contains a row with the maximum relative errors on the validation data. The number of columns depends on the type of algorithm implemented by the subclasses. More...
 
matrix< integerStopFlags = "[]"
 For each effective configuration, the stop flags are stored here. More...
 
integer BestExpConfig
 Index of the best expansion config determined by the algorithm. 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

function kernels.KernelExpansion
kexp = 
templateComputeApproximation (data.ApproxTrainData atd,data.ApproxTrainData avd)
 Performs adaptive approximation generation. More...
 
function  initExpansion (kernels.KernelExpansion kexp,data.ApproxTrainData atd)
 Initializes the Find and set first expansion center. More...
 
function  extendExpansion (kernels.KernelExpansion kexp,data.ApproxTrainData atd,integer idx)
 Extends the kernel expansion kexp by the training data sample in atd given by index idx. More...
 
function bool = checkStop (cnt, rel)
 Checks the stopping conditions for the adaptive approximation algorithm. More...
 
virtual function  startAdaptiveExtension (kernels.KernelExpansion kexp,data.ApproxTrainData atd)
 Runs the actual detailed algorithm. More...
 
- Protected Member Functions inherited from approx.algorithms.ABase
function [ double val ,
integer idx ,
rowvec errs ] = 
getError (kernels.KernelExpansion kexp,data.ApproxTrainData atd)
 Computes the error according to the chosen error function (see ErrorFun property) with respect to the current kernel expansion and the \(f(x_i)\) values in the training data. More...
 
virtual function  templateComputeApproximation (kernels.KernelExpansion kexp,data.ApproxTrainData atd, avd)
 Performs the actual approximation after scaling. More...
 
- 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)
 

Static Protected Member Functions

static function this = loadobj (this, initfrom)
 
- Static Protected Member Functions inherited from approx.algorithms.ABase
static function this = loadobj (this, initfrom)
 
- 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)
 

Protected Attributes

 initialidx
 
- Protected Attributes inherited from approx.algorithms.ABase
 ScalingG
 If UsefScaling is set to true, this matrix contains the scaling matrix which has to be used in sub-algorithms in order to compute the correct approximation error on training data. More...
 

Constructor & Destructor Documentation

approx.algorithms.AAdaptiveBase.AAdaptiveBase ( )

Definition at line 144 of file AAdaptiveBase.m.

References DPCMObject.registerProps().

Here is the call graph for this function:

Member Function Documentation

function bool = approx.algorithms.AAdaptiveBase.checkStop (   cnt,
  rel 
)
protected

Checks the stopping conditions for the adaptive approximation algorithm.

Considers maximum expansion size and maximum relative errors

See Also
MaxExpansionSize MaxRelErr

Definition at line 262 of file AAdaptiveBase.m.

References KerMor.App(), MaxExpansionSize, and MaxRelErr.

Here is the call graph for this function:

function copy = approx.algorithms.AAdaptiveBase.clone (   copy)
virtual

Clones the instance.

Parameters
copyThe subclass instance where to copy the local properties to
Generated fields of copy:

Implements ICloneable.

Definition at line 152 of file AAdaptiveBase.m.

References InitialCenter, initialidx, MaxExpansionSize, MaxRelErr, and Used.

function approx.algorithms.AAdaptiveBase.extendExpansion ( kernels.KernelExpansion  kexp,
data.ApproxTrainData  atd,
integer  idx 
)
protected

Extends the kernel expansion kexp by the training data sample in atd given by index idx.

Parameters
kexpThe kernel expansion
atdThe approximation training data
idxThe index of the center to choose
Required fields of kexp:
Required fields of atd:

Definition at line 237 of file AAdaptiveBase.m.

References kernels.KernelExpansion.Centers, data.ApproxTrainData.hasParams, data.ApproxTrainData.hasTime, data.ApproxTrainData.mui, data.ApproxTrainData.ti, Used, and data.ApproxTrainData.xi.

Referenced by initExpansion().

Here is the caller graph for this function:

function approx.algorithms.AAdaptiveBase.initExpansion ( kernels.KernelExpansion  kexp,
data.ApproxTrainData  atd 
)
protected

Initializes the Find and set first expansion center.

Parameters
kexpA kernel expansion.
atdThe approximation training data.
Required fields of kexp:

Definition at line 221 of file AAdaptiveBase.m.

References kernels.KernelExpansion.clear(), extendExpansion(), initialidx, and Used.

Here is the call graph for this function:

static function this = approx.algorithms.AAdaptiveBase.loadobj (   this,
  initfrom 
)
staticprotected

Definition at line 392 of file AAdaptiveBase.m.

References ExpansionSizes, initialidx, MaxExpansionSize, MaxRelErr, and Used.

function approx.algorithms.AAdaptiveBase.startAdaptiveExtension ( kernels.KernelExpansion  kexp,
data.ApproxTrainData  atd 
)
protectedpure virtual

Runs the actual detailed algorithm.

Parameters
kexpThe kernel expansion
atdThe approximation training data

Referenced by templateComputeApproximation().

Here is the caller graph for this function:

function kernels.KernelExpansion kexp = approx.algorithms.AAdaptiveBase.templateComputeApproximation ( data.ApproxTrainData  atd,
data.ApproxTrainData  avd 
)
protected

Performs adaptive approximation generation.

Parameters
atdThe approximation training data instance
avdA validation data set.
Return values
kexpThe kernel expansion approximation.
Required fields of atd:
Note
This method has the MATLAB method attribute Sealed set to true. It cannot be overwritten.
matlab documentation of method attributes.

Definition at line 175 of file AAdaptiveBase.m.

References ExpansionSizes, approx.algorithms.ABase.ExpConfig, kernels.config.ExpansionConfig.getNumConfigurations(), initialidx, approx.algorithms.ABase.MaxErrors, MaxExpansionSize, approx.algorithms.ABase.MaxRelErrors, startAdaptiveExtension(), approx.algorithms.ABase.ValidationErrors, approx.algorithms.ABase.ValidationRelErrors, and data.ApproxTrainData.xi.

Here is the call graph for this function:

Member Data Documentation

approx.algorithms.AAdaptiveBase.ExpansionSizes
Default:
[]
Note
This property has non-standard access specifiers: SetAccess = Protected, GetAccess = Public
Matlab documentation of property attributes.

Definition at line 114 of file AAdaptiveBase.m.

Referenced by loadobj(), approx.algorithms.VKOGA.startAdaptiveExtension(), and templateComputeApproximation().

approx.algorithms.AAdaptiveBase.InitialCenter = "maxfx"

Determines how the initial center(s) are chosen.

Possible values
  • maxfx The center with the largest (w.r.t. the ABase.ErrorFun norm) associated \(f(x_i)\) value is chosen.
  • center The training point closest to the geometrical center if the training data's bounding box is used.
  • t0 Tries to find a training sample for time zero and uses that. If None are found, the strategy falls back to center. If multiple are found, the one closest to the geometrical center is chosen.
Property class optional:
The first center to choose should not greatly influence the algorithm outcome. The default maxfx is related the closest to the greedy-type approach.

Default: maxfx

Note
This property has the MATLAB attribute SetObservable set to true.
Matlab documentation of property attributes.

Definition at line 85 of file AAdaptiveBase.m.

Referenced by clone().

approx.algorithms.AAdaptiveBase.initialidx
protected
approx.algorithms.AAdaptiveBase.MaxExpansionSize = 300

The maximum size of the expansion to produce.

Equals the maximum number of iterations to perform during adaptive approximation computation as each iteration yields a new center.

Property class alglimit:
Some text describing the importance of this property.

Default: 300

Note
This property has the MATLAB attribute SetObservable set to true.
Matlab documentation of property attributes.
This property has custom functionality when its value is changed.

Definition at line 50 of file AAdaptiveBase.m.

Referenced by checkStop(), clone(), loadobj(), approx.algorithms.VKOGA.startAdaptiveExtension(), and templateComputeApproximation().

approx.algorithms.AAdaptiveBase.MaxRelErr = 1e-5

Stopping condition property. Maximum relative error that may occur.

Property class critical:

Default: 1e-5

Note
This property has the MATLAB attribute SetObservable set to true.
Matlab documentation of property attributes.
This property has custom functionality when its value is changed.

Definition at line 70 of file AAdaptiveBase.m.

Referenced by checkStop(), clone(), loadobj(), and approx.algorithms.VKOGA.startAdaptiveExtension().

approx.algorithms.AAdaptiveBase.Used = "[]"

The indices of the effectively used centers during the.

Note
This property has non-standard access specifiers: SetAccess = Protected, GetAccess = Public
Matlab documentation of property attributes.
Default: "[]"

Definition at line 125 of file AAdaptiveBase.m.

Referenced by clone(), extendExpansion(), initExpansion(), loadobj(), and approx.algorithms.VKOGA.startAdaptiveExtension().


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