Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
areslp committed Mar 21, 2013
1 parent 4088ba2 commit 142c15d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions multi_NNLRS.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
cmu(1:k)={mu};
% update S_i
Sk=S;
[S, svp]=cellfun(@updateS,xtx,X,E,Y1,Z,S,Sk,Y3,eta1,cmu,'UniformOutput',false);
[S, svp]=cellfun(@updateS,xtx,X,E,Y1,Z,S,Y3,eta1,cmu,'UniformOutput',false);
% update J_i
Jk=J;
[J]=cellfun(@updateJ,Z,J,Y2,cmu,cbeta,'UniformOutput',false);
Expand All @@ -87,7 +87,7 @@
for i=1:k
ZZ(i,:)=M{i};
end
ZZ=l21(ZZ,alpha/mu);
ZZ=l21(ZZ,alpha/(2*mu));
% update Z_i
Zk=Z;
for i=1:k
Expand Down Expand Up @@ -139,13 +139,13 @@
iter=iter+1;
end

function [S,svp] = updateS(xtx,X,E,Y1,Z,S,Sk,Y3,eta1,mu)
T=-mu*(xtx-xtx*S+X'*E+X'*Y1/mu+Z-S+Y3/mu);
function [S,svp] = updateS(xtx,X,E,Y1,Z,S,Y3,eta1,mu)
T=-mu*(xtx-xtx*S-X'*E+X'*Y1/mu+Z-S+Y3/mu);
% argmin_{S} 1/(mu*eta1)||S||_*+1/2*||S-S_k+T/(mu*eta1)||_F^2
[S,svp]=singular_value_shrinkage(Sk-T/(mu*eta1),1/(mu*eta1)); % TODO: sometimes PROPACK is slower than full svd, and sometimes it will throw the following error
[S,svp]=singular_value_shrinkage(S-T/(mu*eta1),1/(mu*eta1)); % TODO: sometimes PROPACK is slower than full svd, and sometimes it will throw the following error

function [J] = updateJ(Z,J,Y2,mu,beta)
J=wthresh(Z+Y2/mu,'s',2*beta);
J=wthresh(Z+Y2/mu,'s',beta/mu);

function [RET] = updateF(J,Y2,S,Y3,mu)
RET=1/2*(J-Y2/mu+S-Y3/mu);
Expand Down

0 comments on commit 142c15d

Please sign in to comment.