关键字:核函数,RBF 超参数调优
对这个很熟悉了,简单写一下
本人用matlab实现了一下,代码如下(共如下4个文件):
KK.m 文件:
function [ a ] = KK( x1,x2 )
%UNTITLED7 Summary of this function goes here
% Detailed explanation goes here
sigmaa=1.61
l=0.99769
a=sigmaa*exp(-(x1-x2)^2/(2*l*l))
end
Aveaged.m
function [ a ] =Aveaged( kx,K,y)
a=kx'*inv(K)*y;
%UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
end
Squared.m
function [ a ] = Squared( kx,K )
%UNTITLED5 Summary of this function goes here
% Detailed explanation goes here
a=-kx'*inv(K)*kx+1.7
end
drawings.m
% n=50;
% x=linspace(40,70,n);
% y= 7*x + normrnd(0,5,size(x));
% plot(x,y)
% hold on;
% [p,s]=polyfit(x,y,1);
% [yfit,dy]=polyconf(p,x,s,'predopt','curve');
% fill([x,fliplr(x)],[yfit-dy,fliplr(yfit+dy)],[0.8706 0.9216 0.9804])
% line(x,yfit,'color','r')
% line(x,yfit-dy,'color','r','linestyle',':')
% line(x,yfit+dy,'color','r','linestyle',':')
% x=0:pi/100:2*pi;
% y=sin(x);
% plot(x,y,'r:')
N=20
orgin_x=[-1.5,-1,-0.75,-0.4,-0.25,0]'
orgin_y=[-1.6,-1.2