28 k = kernels.GaussKernel(1);
30 f = kernels.KernelExpansion;
40 h = pm.
nextPlot(
" rkhs_demo ",
" Example kernel expansion ",
" x ",
" f(x) ");
42 plot(h,x,f.evaluate(x),
" r ",
" LineWidth ",lw);
44 plot(h,x,0,
" k ",
" LineWidth ",lw);
48 plot(h,x,f.evaluate(x),
" r-- ");
49 plot(h,c(i),0,
" b. ",
" MarkerSize ",20);
50 plot(h,[c(i) c(i)+eps],[0 a(i)],
" k-- ");
55 fprintf(
" Just ignore the following two warnings about file locations!\n ");
56 load(fullfile(
" +demos ",
" spine_training_data_set.mat "));
59 alg = approx.algorithms.VKOGA;
61 alg.MaxExpansionSize= 600;
63 alg.UsefPGreedy=
false;
69 gammas = linspace(15,70,nG);
71 wc = kernels.config.WendlandConfig(
" G ",comb(1,:),
" S ",comb(2,:));
73 ec = kernels.config.ExpansionConfig;
78 kexp = alg.computeApproximation(atd);
79 kexp_dbase = kexp.toTranslateBase;
80 save basics5_kernelsandapprox;
Collection of generally useful functions.
static function comb = createCombinations(ranges, varargin)
Creates the cartesian product of the vectors passed as a matrix containing elements of each vector pe...
function varargout = FunVis2D(varargin)
User interface to visualize highdimensional functions using two input dimensions and one output dimen...
PlotManager: Small class that allows the same plots generated by some script to be either organized a...
function axes ax_handle = nextPlot(char tag,char caption,char xlab,char ylab,cell< char > leg_str,integer numsubplots)
Creates a new axis to plot in. Depending on the property tools.PlotMananger.Single this will either a...
function Basics5_KernelsAndApprox()
Basics5_KernelsAndApprox: