📄 calcquad.m
字号:
%=====================================================================
%% 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -