145 this =
this@approx.algorithms.ABase;
148 this.
registerProps(
" MaxExpansionSize ",
" MaxRelErr ",
" InitialCenter ");
153 copy =
clone@approx.algorithms.ABase(
this, copy);
160 copy.Used= this.
Used;
179 warning(
" AAdaptiveBase:expansionsize ",...
180 " Only %d training samples but having MaxExpansionSize=%d, changing to %d. ",...
181 size(atd.
xi,2),
this.MaxExpansionSize,size(atd.
xi,2));
194 [~, this.
initialidx] = this.getInitialCenter(atd);
238 kexp.
Centers.xi(:,end+1) = atd.
xi(:,idx);
245 this.
Used(end+1) = idx;
267 fprintf(
" AAdaptiveBase stopping criteria holds: Max expansion size %d reached.\n ",this.
MaxExpansionSize);
272 fprintf(
" AAdaptiveBase stopping criteria holds: Relative error %.7e < %.7e\n ",rel,this.
MaxRelErr);
311 c = [c; atd.
ti(idx)];
314 c = [c; atd.
mui(:,idx)];
320 idx = find(atd.ti == 0);
322 c = [atd.xi(:,idx); zeros(1,numel(idx))];
324 c = [c; atd.mui(:,idx)];
327 [~,i] = min(sum((c-repmat(atd.Center,1,numel(idx))).^2,1));
367 #if 0 //mtoc++: 'set.MaxExpansionSize'
370 error(" Value must be a positive
integer. ");
379 #if 0 //mtoc++: 'set.MaxRelErr'
382 error(" The value must be a positive scalar ");
392 static function this =
loadobj(
this,initfrom) {
395 this.InitialCenter= initfrom.InitialCenter;
396 if isfield(initfrom,
" initialidx ")
399 if isfield(initfrom,
" Used ")
400 this.
Used= initfrom.Used;
403 this.InitialCenter= initfrom.InitialCenter;
405 this =
loadobj@approx.algorithms.ABase(
this, initfrom);
matrix< double > ValidationErrors
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.
logical hasParams
Flag that indicates if param samples are present.
matrix< double > MaxRelErrors
For each configuration, contains a row with the maximum relative errors on the training data...
data.FileMatrix xi
The state space samples , stored row-wise in a data.FileMatrix instance.
data.FileMatrix fxi
The evaluations of , stored row-wise in a data.FileMatrix.
char InitialCenter
Determines how the initial center(s) are chosen.
function [ colvec< double > c , integer idx ] = getClosestToCenter()
The sample triple closest to the Center.
function registerProps(varargin)
Call this method at any class that defines DPCM observed properties.
matrix< double > ValidationRelErrors
For each configuration, contains a row with the maximum relative errors on the validation data...
kernels.config.ExpansionConfig ExpConfig
The different kernel expansion configurations to try.
rowvec ti
The time samples .
function bool = checkStop(cnt, rel)
Checks the stopping conditions for the adaptive approximation algorithm.
Used
The indices of the effectively used centers during the.
function_handle ErrorFun
The error function to apply on each data vector.
function kernels.KernelExpansion kexp = templateComputeApproximation(data.ApproxTrainData atd,data.ApproxTrainData avd)
Performs adaptive approximation generation.
function copy = clone(copy)
Clones the instance.
function clear()
Removes all centers and coefficients from the expansion and leaves the associated kernels untouched...
function n = getNumConfigurations()
Returns the number of configurations that can be applied.
logical hasTime
Flag that indicates if time samples are present.
matrix mui
The parameter samples used computing the parent trajectories of .
matrix< double > MaxErrors
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.
ABase: Base class for any approximation generation algorithms for kernel expansions,.
Base class for adaptive component-wise kernel approximation algorithms.
function res = isposintscalar(value)
isposintscalar: Backwards-compatibility function for matlab versions greater than 2012a ...
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...
Global configuration class for all KerMor run-time settings.
ApproxTrainData: Data class for approximation training data, containing several useful bounding box p...
struct Centers
The kernel centers used in the approximation.
static function KerMor theinstance = App()
The singleton KerMor instance.
A MatLab character array.
double MaxRelErr
Stopping condition property. Maximum relative error that may occur.
function res = isposrealscalar(value)
isposintscalar: Backwards-compatibility function for matlab versions greater than 2012a ...
static function this = loadobj(this, initfrom)
function initExpansion(kernels.KernelExpansion kexp,data.ApproxTrainData atd)
Initializes the Find and set first expansion center.
virtual function startAdaptiveExtension(kernels.KernelExpansion kexp,data.ApproxTrainData atd)
Runs the actual detailed algorithm.
colvec< double > ExpansionSizes
KernelExpansion: Base class for state-space kernel expansions.
integer MaxExpansionSize
The maximum size of the expansion to produce.