Home > dal > l1_softth.m

l1_softth

PURPOSE ^

l1_softth - soft threshold function for L1 regularization

SYNOPSIS ^

function vv=l1_softth(vv,lambda,info)

DESCRIPTION ^

 l1_softth - soft threshold function for L1 regularization

 Copyright(c) 2009 Ryota Tomioka
 This software is distributed under the MIT license. See license.txt

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % l1_softth - soft threshold function for 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=l1_softth(vv,lambda,info)
0007 
0008 n = size(vv,1);
0009 
0010 Ip=find(vv>lambda);
0011 In=find(vv<-lambda);
0012 
0013 vv=sparse([Ip;In],1,[vv(Ip)-lambda;vv(In)+lambda],n,1);

Generated on Sat 22-Aug-2009 22:15:36 by m2html © 2003