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
data.ApproxTrainData Class Reference

ApproxTrainData: Data class for approximation training data, containing several useful bounding box properties etc. More...

Detailed Description

ApproxTrainData: Data class for approximation training data, containing several useful bounding box properties etc.

Author
Daniel Wirtz
Date
2011-11-02
New in 0.6:
(Daniel Wirtz, 2012-07-18) Moved computation method for approx train data from models.BaseFullModel to here.
New in 0.6:
(Daniel Wirtz, 2011-11-16) Added a new method data.ApproxTrainData.getCombinedData which returns the triples \(x_i,t_i,\mu_i\) as one column matrix.
New in 0.5:
(Daniel Wirtz, 2011-11-02) Added this class.
Todo:
Make xi,ti,mui private fields and update dependents like Center upon re-setting one of those values! (consistency issue)

This class is part of the framework

KerMor - Model Order Reduction using Kernels

Definition at line 18 of file ApproxTrainData.m.

Public Member Functions

 ApproxTrainData (matrix< double > xi,rowvec< double > ti,matrix< double > mui)
 Creates a new approx train data instance. More...
 
function [ colvec< double > c ,
integer idx ] = 
getClosestToCenter ()
 The sample triple closest to the Center. More...
 
function satd = subset (sel)
 
function [ train ,

validation ,
randidx ] = 
splitToTrainValidationSets (perc, seed)
 Creates a training and validation data set from this approx train data instance. More...
 
function [ e ,
lbl ,
pt ] = 
getErrorsFor (fun)
 
function  relocate (char new_dir)
 Convenience method. Relocates the xi and fxi FileMatrix instances if present. More...
 
function  delete ()
 
function  makeUniqueXi ()
 
function [
minDist ,
meanDist ,
maxDist ] = 
getXiDists ()
 

Static Public Member Functions

static function data.ApproxTrainData atd = computeFrom (models.BaseFullModel model,dscomponents.ACoreFun f,data.selection.ASelector selector,logical parallel)
 Computes approximation training data for a model, function and selector. More...
 
static function [
data.ApproxTrainData atd ,

minScale ,
maxScale ] = 
scaleXiZeroOne (data.ApproxTrainData atd)
 

Public Attributes

data.FileMatrix xi = "[]"
 The state space samples \(x_i = x(t_i;\mu_i)\), stored row-wise in a data.FileMatrix instance. More...
 
rowvec ti = "[]"
 The time samples \(t_i\). More...
 
matrix mui = "[]"
 The parameter samples \(\mu_i\) used computing the parent trajectories of \(x_i\). More...
 
data.FileMatrix fxi
 The evaluations of \(f(x_i,t_i,\mu_i)\), stored row-wise in a data.FileMatrix. More...
 
colvec Center
 The geometrical center of the datas bounding box. More...
 
double xiDia
 The diameter of the state space samples. More...
 
double tiDia
 The time span of the time samples. More...
 
double muiDia
 The diameter of the parameter space samples. More...
 
logical hasTime = false
 Flag that indicates if time samples are present. More...
 
logical hasParams = false
 Flag that indicates if param samples are present. More...
 
integer tOff = "[]"
 The index of the time entry in the combined \([x;t;\mu]\) vector. More...
 
integer muOff = "[]"
 The index of the first parameter entry in the combined \([x;t;\mu]\) vector. More...
 
struct Box = "[]"
 A box struct allowing access to the specific min and max values of the samples. Recommended for Debug use only. 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...
 

Constructor & Destructor Documentation

data.ApproxTrainData.ApproxTrainData ( matrix< double xi,
rowvec< double ti,
matrix< double mui 
)

Creates a new approx train data instance.

Leave \(t_i\) and/or \(\mu_i\) empty if no time or parameter training data is present.

Assign local variables

Parameters
xiThe state space samples \(x_i\)
tiThe time instances \(t_i\)
muiThe parameter samples \(\mu_i\)
Required fields of xi:

Definition at line 218 of file ApproxTrainData.m.

References Box, Center, Utils.getBoundingBox(), hasParams, hasTime, mui, muiDia, muOff, ti, tiDia, tOff, xi, and xiDia.

Referenced by models.BaseFullModel.off4_genApproximationTrainData().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Function Documentation

function data.ApproxTrainData atd = data.ApproxTrainData.computeFrom ( models.BaseFullModel  model,
dscomponents.ACoreFun  f,
data.selection.ASelector  selector,
logical  parallel 
)
static

Computes approximation training data for a model, function and selector.

This method is implemented here as both the original offline phase 4 uses this method but also the DEIM error estimator needs the same routine for the MatrixDEIM approximation.

See Also
models.BaseFullModel error.DEIMEstimator
Parameters
modelThe full model instance
fThe model's core function
selectorThe training data selector
parallelFlag to set if computation should be done in parallel (MatlabPool) Default: false
Required fields of selector:
Required fields of model:
Required fields of f:
Generated fields of atd:

Definition at line 456 of file ApproxTrainData.m.

References KerMor.App(), data.FileMatrix.bCols, models.BaseFullModel.Data, data.FileData.DataDirectory, dscomponents.ACoreFun.evaluateMulti(), dscomponents.ACoreFun.fDim, data.FileMatrix.FileMatrix(), fxi, mui, data.FileMatrix.n, data.FileMatrix.nBlocks, models.BaseFullModel.ProjectApproxTrainingData, data.selection.ASelector.selectTrainingData(), t, and xi.

Here is the call graph for this function:

function data.ApproxTrainData.delete ( )

Definition at line 382 of file ApproxTrainData.m.

References fxi, and xi.

function [ colvec< double > c , integer idx ] = data.ApproxTrainData.getClosestToCenter ( )

The sample triple closest to the Center.

Return values
cA column vector composed as \([x; t; mu]\)
idxThe index in xi,ti,mui samples

Definition at line 275 of file ApproxTrainData.m.

References Center, mui, ti, and xi.

function [e , lbl , pt ] = data.ApproxTrainData.getErrorsFor (   fun)

Definition at line 325 of file ApproxTrainData.m.

References PrintTable.Caption, fxi, k, Norm.L1(), Norm.L2(), t, data.ABlockedData.toMemoryMatrix(), and xi.

Here is the call graph for this function:

function [minDist , meanDist , maxDist ] = data.ApproxTrainData.getXiDists ( )

Definition at line 411 of file ApproxTrainData.m.

References data.ABlockedData.toMemoryMatrix(), and xi.

Here is the call graph for this function:

function data.ApproxTrainData.makeUniqueXi ( )

Definition at line 388 of file ApproxTrainData.m.

References KerMor.App(), fxi, mui, data.FileMatrix.spawnWithContent(), t, ti, data.ABlockedData.toMemoryMatrix(), and xi.

Here is the call graph for this function:

function data.ApproxTrainData.relocate ( char  new_dir)

Convenience method. Relocates the xi and fxi FileMatrix instances if present.

New in 0.7:
(Daniel Wirtz, 2013-05-28) Added this method.
Parameters
new_dirThe new directory

Definition at line 364 of file ApproxTrainData.m.

References fxi, data.FileMatrix.relocate(), and xi.

Referenced by data.ModelData.relocate().

Here is the call graph for this function:

Here is the caller graph for this function:

static function [data.ApproxTrainDataatd , minScale , maxScale ] = data.ApproxTrainData.scaleXiZeroOne ( data.ApproxTrainData  atd)
static

Definition at line 562 of file ApproxTrainData.m.

References xi.

function [ train , validation , randidx ] = data.ApproxTrainData.splitToTrainValidationSets (   perc,
  seed 
)

Creates a training and validation data set from this approx train data instance.

Definition at line 309 of file ApproxTrainData.m.

References subset(), and xi.

Here is the call graph for this function:

function satd = data.ApproxTrainData.subset (   sel)

Definition at line 291 of file ApproxTrainData.m.

References fxi, mui, ti, and xi.

Referenced by splitToTrainValidationSets().

Here is the caller graph for this function:

Member Data Documentation

data.ApproxTrainData.Box = "[]"

A box struct allowing access to the specific min and max values of the samples. Recommended for Debug use only.

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

Definition at line 201 of file ApproxTrainData.m.

Referenced by ApproxTrainData().

data.ApproxTrainData.Center

The geometrical center of the datas bounding box.

A column vector composed as \([x; t; mu]\)

Note
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.

Definition at line 94 of file ApproxTrainData.m.

Referenced by ApproxTrainData(), and getClosestToCenter().

data.ApproxTrainData.hasParams = false

Flag that indicates if param samples are present.

Default:
false
Note
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.
Default: false

Definition at line 157 of file ApproxTrainData.m.

Referenced by ApproxTrainData(), approx.algorithms.AAdaptiveBase.extendExpansion(), kernels.config.RBFConfig.getDists(), kernels.config.ExpansionConfig.guessGammaConfigs(), and kernels.ParamTimeKernelExpansion.setCentersFromATD().

data.ApproxTrainData.hasTime = false

Flag that indicates if time samples are present.

Default:
false
Note
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.
Default: false

Definition at line 144 of file ApproxTrainData.m.

Referenced by ApproxTrainData(), approx.algorithms.AAdaptiveBase.extendExpansion(), kernels.config.RBFConfig.getDists(), kernels.config.ExpansionConfig.guessGammaConfigs(), and kernels.ParamTimeKernelExpansion.setCentersFromATD().

data.ApproxTrainData.muiDia

The diameter of the parameter space samples.

Note
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.

Definition at line 132 of file ApproxTrainData.m.

Referenced by ApproxTrainData(), kernels.config.RBFConfig.getDists(), and kernels.config.ExpansionConfig.guessGammaConfigs().

data.ApproxTrainData.muOff = "[]"

The index of the first parameter entry in the combined \([x;t;\mu]\) vector.

Zero means no parameter samples are present.

Default: 0

Note
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.

Definition at line 185 of file ApproxTrainData.m.

Referenced by ApproxTrainData().

data.ApproxTrainData.tiDia

The time span of the time samples.

Note
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.

Definition at line 120 of file ApproxTrainData.m.

Referenced by ApproxTrainData(), kernels.config.RBFConfig.getDists(), and kernels.config.ExpansionConfig.guessGammaConfigs().

data.ApproxTrainData.tOff = "[]"

The index of the time entry in the combined \([x;t;\mu]\) vector.

Zero means no time samples are present.

Default: 0

Note
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.

Definition at line 170 of file ApproxTrainData.m.

Referenced by ApproxTrainData().

data.ApproxTrainData.xiDia

The diameter of the state space samples.

Note
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.

Definition at line 108 of file ApproxTrainData.m.

Referenced by ApproxTrainData(), kernels.config.RBFConfig.getDists(), and kernels.config.ExpansionConfig.guessGammaConfigs().


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