calcquad.m

来自「这个是支持向量聚类机用matlab编译的主程序和部分子程序」· M 代码 · 共 34 行

M
34
字号

%=====================================================================
%%	CalcQuad:
%	---------
%%	Parameters:   %		N    - The number of Samples.
%		beta - Vector of the Lagrangian multipliers
%		K    - The Mercer Kernel (Gaussian)
%			   the inner product of the points' images.                %%	Return Value:
%		quad - sum over all pairs i,j : 
%			   beta(i) * beta(j) * image(i)image(j)
%       %   Calculates the quadratic part of the Wolfe dual form,
%	and the distance from the sphere's center. (see docmentation)
%%=====================================================================
function [quad] = CalcQuad(N,beta,K)% initializationquad = 0;% sum over all data points' pairsfor i = 1:N    for j = 1:N        quad = quad + beta(i) * beta(j) * K(i,j);%这里的N和beta是否应该考虑beta(j)==0?我想如果对于大数据量时,应该考虑而减小计算量.    endend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?