📄 ker.m
字号:
% type = 'poly', 'grbf', 'norm'
%function [v]=ker(kerType, x1, x2)
function [v]=ker(kerType, x1, x2)
% const
% polynomial
c1 = 0.0001; theta = 0;
% gaussian RBF
c2 = 400;
if kerType=='poly' % polynomial
v = (c1*(x1'*x2)+theta)^2;
elseif kerType == 'grbf' % gaussian RBF
v = exp(-norm((x1-x2), 2)/c2);
elseif kerType == 'norm'
v = x1'*x2;
else
v = 0.0;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -