91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 736B
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-05
  • 語(yǔ)言: Matlab
  • 標(biāo)簽: ??核函數(shù)??算法??

資源簡(jiǎn)介

介紹幾種常用核函數(shù)MATLAB的算法,附說(shuō)明

資源截圖

代碼片段和文件信息

function?[K]?=?kernel(kerxy)
%?Calculate?kernel?function.???
%
%?x:?輸入樣本d×n1的矩陣n1為樣本個(gè)數(shù)d為樣本維數(shù)
%?y:?輸入樣本d×n2的矩陣n2為樣本個(gè)數(shù)d為樣本維數(shù)
%
%?ker??核參數(shù)(結(jié)構(gòu)體變量)
%?the?following?fields:
%???type???-?linear?:??k(xy)?=?x‘*y
%????????????poly???:??k(xy)?=?(x‘*y+c)^d
%????????????gauss??:??k(xy)?=?exp(-0.5*(norm(x-y)/s)^2)
%????????????tanh???:??k(xy)?=?tanh(g*x‘*y+c)
%???degree?-?Degree?d?of?polynomial?kernel?(positive?scalar).
%???offset?-?Offset?c?of?polynomial?and?tanh?kernel?(scalar?negative?for?tanh).
%???width??-?Width?s?of?Gauss?kernel?(positive?scalar).
%???gamma??-?Slope?g?of?the?tanh?kernel?(positive?scalar).
%
%?ker?=?struct(‘type‘‘linear‘);
%?ker?=?struct(‘type‘‘ploy‘‘degree‘d‘offset‘c);
%?ker?=?struct(‘type‘‘gauss‘‘width‘s);
%?ker?=?struct(‘type‘‘tanh‘‘gamma‘g‘offset‘c);
%
%?K:?輸出核參數(shù)n1×n2的矩陣

%-------------------------------------------------------------%

switch?ker.type
????case?‘linear‘
????????K?=?x‘*y;
????case?‘ploy‘
????????d?=?ker.degree;
????????c?=?ker.offset;
????????K?=?(x‘*y+c).^d;
????case?‘gauss‘
????????
????????s?=?ker.width;
????????rows?=?size(x2);
????????cols?=?size(y2);???
????????tmp?=?zeros(rowscols);
????????for?i?=?1:rows
????????????for?j?=?1:cols
????????????????tmp(ij)?=?norm(x(:i)-y(:j));
????????????end
????????end????????
????????K?=?exp(-0.5*(tmp/s).^2);

????case?‘tanh‘
????????g?=?ker.gamma;
????????c?=?ker.offset;
????????K?=?tanh(g*x‘*y+c);
????otherwise
????????K?=?0;
end

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件???????1510??2007-07-02?13:49??kernel.m

-----------?---------??----------?-----??----

?????????????????1510????????????????????1


評(píng)論

共有 條評(píng)論