📄 dualmaxsparsealignmentlm.m
字号:
function [b, tau] = dualMaxSparseAlignmentLM(K, Kj, Y, Yj, previousTau, previousB, startExample)
%A function to compute the maximum sparse target alignment 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 alignment
numPartialExamples = size(Kj, 2);
numTotalExamples = size(Kj, 1);
columnIndices = (startExample:startExample+numPartialExamples-1)';
normSquarePreviousTau = previousTau'*previousTau;
if normSquarePreviousTau ~= 0
previousAlignment = (previousTau'*Yj)^2/(normSquarePreviousTau*(Y'*Y));
else
previousAlignment = -1;
end
[alignments, bs] = sparseAlignments(K, Kj, Y, Yj, columnIndices);
[maxAlignment, i] = max(abs(alignments));
if maxAlignment > previousAlignment
b = zeros(numTotalExamples, 1);
b(i+startExample-1) = bs(i);
tau = Kj(:, i)*bs(i);
else
b = previousB;
tau = previousTau;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -