📄 dualmaxsparsecovariancelm.m.svn-base
字号:
function [b, tau] = dualMaxSparseCovarianceLM(K, Kj, Y, Yj, previousTau, previousB, startExample)
%A function to compute the maximum sparse covariance vector between partial kernel matrix
%K and vector y. Works on chunks of cols of the kernel matrix, i.e. the whole kernel matrix need not be
%in memory.
%We just use the example with the highest absolute covariance
numPartialExamples = size(Kj, 2);
numTotalExamples = size(Kj, 1);
columnIndices = (startExample:(startExample+numPartialExamples-1))';
previousCovariance = abs(previousTau'*Yj);
covariances = sparseCovariances(K, Kj, Y, Yj, columnIndices);
[maxCovariance, i] = max(abs(covariances));
%Note that b is scaled so that ||X'b|| = 1
if maxCovariance > previousCovariance
a = sqrt(abs(K(i+startExample-1, i)))*sign(covariances(i));
b = zeros(numTotalExamples, 1);
b(i+startExample-1) = 1/a;
tau = Kj(:, i)'/a; %Tau is the ith column of this part of Kj
else
b = previousB;
tau = previousTau;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -