norml12_project.m
来自「Spectral Projected L1 solver」· M 代码 · 共 25 行
M
25 行
function x = NormL12_project(g,x,weights,tau)% Projection with number of groups equal to g% Convert to matrixm = round(length(x) / g); n = g;x = reshape(x,m,n);% Compute two-norms of rowsif isreal(x) xa = sqrt(sum(x.^2,2));else xa = sqrt(sum(abs(x).^2,2));end% Project one one-norm ballidx = xa < eps;xc = oneProjector(xa,weights,tau);% Scale originalxc = xc ./ xa; xc(idx) = 0;x = spdiags(xc,0,m,m)*x;% Vectorize resultx = x(:);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?