gl_softth - soft threshold function for grouped L1 regularization Copyright(c) 2009 Ryota Tomioka This software is distributed under the MIT license. See license.txt
0001 % gl_softth - soft threshold function for grouped L1 regularization 0002 % 0003 % Copyright(c) 2009 Ryota Tomioka 0004 % This software is distributed under the MIT license. See license.txt 0005 0006 function [vv,ss]=gl_softth(vv, lambda,info) 0007 0008 ss=zeros(length(info.blks),1); 0009 ix0=0; 0010 for kk=1:length(info.blks) 0011 I=ix0+(1:info.blks(kk)); 0012 ix0=I(end); 0013 ss(kk)=norm(vv(I)); 0014 ssk=max(ss(kk)-lambda,0); 0015 if ssk>0 0016 vv(I)=ssk/ss(kk)*vv(I); 0017 else 0018 vv(I)=0; 0019 end 0020 ss(kk)=ssk; 0021 end 0022 0023 0024