Skip to content

Commit

Permalink
Renaming OrderedLASSO to SLOPE and prox_Ol1.m to prox_Sl1.m
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenbeckr committed Oct 30, 2013
1 parent a362f9e commit 9bf1dfb
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 18 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
-- Note --
As of the move to github on Oct 2013, we will not mention
minor changes in this changelog since minor changes
can be viewed automatically using github's versioning tools
----------

Oct 29 2013, v1.3 release 2
Renaming solver_OrderedLASSO.m to solver_SLOPE.m
Renaming prox_Ol1.m to prox_Sl1.m
Renaming examples/smallscale/test_OrderedLASSO.m to ...test_SLOPE.m

Oct 10 2013, v1.3
License changed! See LICENSE for details
New:
Expand Down
4 changes: 2 additions & 2 deletions Contents.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
% prox_hinge - Hinge-loss function.
% prox_hingeDual - Dual function of the Hinge-loss function.
% prox_l1 - L1 norm.
% prox_Ol1 - Ordered L1 norm.
% prox_Sl1 - Sorted (aka ordered) L1 norm.
% prox_l1l2 - L1-L2 block norm: sum of L2 norms of rows.
% prox_l1linf - L1-LInf block norm: sum of L2 norms of rows.
% prox_l1pos - L1 norm, restricted to x >= 0
Expand Down Expand Up @@ -87,7 +87,7 @@
% Premade solvers for specific problems (vector variables)
% solver_L1RLS - l1-regularized least squares problem, sometimes called the LASSO.
% solver_LASSO - Minimize residual subject to l1-norm constraints.
% solver_OrderedLASSO - LASSO using ordered l1-norm.
% solver_SLOPE - Sorted L One Penalized Estimation (LASSO using sorted/ordered l1 norm)
% solver_sBP - Basis pursuit (l1-norm with equality constraints). Uses smoothing.
% solver_sBPDN - Basis pursuit de-noising. BP with relaxed constraints. Uses smoothing.
% solver_sBPDN_W - Weighted BPDN problem. Uses smoothing.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%{
Tests the Ordered LASSO ( aka Ordered L1 regularized Least Squares) problem
Tests the Sorted/Ordered LASSO ( aka Ordered L1 regularized Least Squares) problem
Also known as SLOPE for Sorted L-One Penalized Estimation
min_x sum(lambda*sort(abs(x),'descend')) + .5||A(x)-b||_2^2
Expand All @@ -23,7 +24,7 @@ min_x sum(lambda*sort(abs(x),'descend')) + .5||A(x)-b||_2^2
%%
% Try to load the problem from disk
fileName = fullfile(tfocs_where,...
'examples','smallscale','reference_solutions','ordered_asso_problem1_noisy');
'examples','smallscale','reference_solutions','ordered_lasso_problem1_noisy');
randn('state',34324);
rand('state',34324);
N = 1024;
Expand Down Expand Up @@ -57,7 +58,7 @@ min_x sum(lambda*sort(abs(x),'descend')) + .5||A(x)-b||_2^2

% We cannot get the solution via CVX easily, so solve using our method
opts = struct('restart',-Inf,'tol',1e-13,'maxits',1000, 'printEvery',10);
[ x, out, optsOut ] = solver_OrderedLASSO( A, b, lambda, x0, opts );
[ x, out, optsOut ] = solver_SLOPE( A, b, lambda, x0, opts );
x_ref = x;
obj_ref = norm(A*x-b)^2/2 + sum(lambda(:).*sort(abs(x),'descend'));

Expand Down Expand Up @@ -85,7 +86,7 @@ min_x sum(lambda*sort(abs(x),'descend')) + .5||A(x)-b||_2^2
opts.errFcn = { @(f,primal) er(primal), ...
@(f,primal) f - obj_ref };
tic;
[ x, out, optsOut ] = solver_OrderedLASSO( A, b, lambda, x0, opts );
[ x, out, optsOut ] = solver_SLOPE( A, b, lambda, x0, opts );
time_TFOCS = toc;

fprintf('Solution has %d nonzeros. Error vs. reference solution is %.2e\n',...
Expand Down
8 changes: 4 additions & 4 deletions prox_Ol1.m → prox_Sl1.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function op = prox_Ol1( lambda )
%PROX_OL1 Ordered L1 norm.
function op = prox_Sl1( lambda )
%PROX_SL1 Sorted/Ordered L1 norm.
% OP = PROX_L1( lambda ) implements the nonsmooth function
% OP(X) = sum(lambda.*sort(abs(X),'descend'))
% where lambda is strictly positive and sorted in decreasing order,
Expand Down Expand Up @@ -28,7 +28,7 @@
error( 'Argument lambda must be sorted in decreasing order.');
end
if numel(lambda)==1
warning('TFOCS:prox_OL1','When lambda is a scalar, we recommend prox_l1.m instead pf prox_OL1.m');
warning('TFOCS:prox_SL1','When lambda is a scalar, we recommend prox_l1.m instead pf prox_SL1.m');
end


Expand All @@ -39,7 +39,7 @@
makeMex;
% check that it worked
if 3 ~= exist('proxAdaptiveL1Mex','file')
disp('Compilation of mex files for prox_OL1.m failed; please report this error');
disp('Compilation of mex files for prox_SL1.m failed; please report this error');
end
end

Expand Down
15 changes: 9 additions & 6 deletions solver_OrderedLASSO.m → solver_SLOPE.m
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
function [ x, odata, opts ] = solver_OrderedLASSO( A, b, lambda, x0, opts )
% SOLVER_ORDEREDLASSO l1-regularized least squares problem, sometimes called the LASSO,
% [ beta, odata, opts ] = solver_L1RLS( X, y, lambda, beta0, opts )
% Solves the l1-regularized least squares problem, using the ordered l1 norm,
function [ x, odata, opts ] = solver_SLOPE( A, b, lambda, x0, opts )
% SOLVER_SLOPE Sorted l1-regularized least squares problem,
% [ beta, odata, opts ] = solver_SLOPE( X, y, lambda, beta0, opts )
% Solves the l1-regularized least squares problem, using the sorted/ordered l1 norm,
% minimize (1/2)*norm( A * x - b )^2 + norm( lasso.*sort(abs(x),'descend'), 1 )
% using the Auslender/Teboulle variant with restart. X must be a matrix
% or a linear operator, y must be a vector, and lambda must be a real
% positive vector in decreasing order.
% The initial point beta0 and option structure opts are both optional.
%
% SLOPE stands for Sorted L-One Penalized Estimation
%
% Reference:
% "Statistical Estimation and Testing via the Ordered l1 Norm"
% by M. Bogdan, E. van den Berg, W. Su, and E. J. Candès, 2013
% http://www-stat.stanford.edu/~candes/OrderedL1/
%
% See also solver_L1RLS.m, solver_LASSO.m, prox_Ol1.m
% See also solver_L1RLS.m, solver_LASSO.m, prox_Sl1.m

error(nargchk(3,5,nargin));
if nargin < 4, x0 = []; end
Expand All @@ -21,7 +24,7 @@
opts.restart = 100;
end

[x,odata,opts] = tfocs( smooth_quad, { A, -b }, prox_Ol1( lambda ), x0, opts );
[x,odata,opts] = tfocs( smooth_quad, { A, -b }, prox_Sl1( lambda ), x0, opts );

% TFOCS v1.3 by Stephen Becker, Emmanuel Candes, and Michael Grant.
% Copyright 2013 California Institute of Technology and CVX Research.
Expand Down
4 changes: 2 additions & 2 deletions userguide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ \section{Appendix: list of TFOCS functions}
\verb@prox_hinge@ & Hinge-loss function. \\
\verb@prox_hingeDual@ & Dual function of the Hinge-loss function. \\
\verb@prox_l1@ & L1 norm. \\
\verb@prox_Ol1@ & Ordered L1 norm. \\
\verb@prox_Sl1@ & Sorted (aka) ordered L1 norm. \\
\verb@prox_l1l2@ & L1-L2 block norm: sum of L2 norms of rows. \\
\verb@prox_l1linf@ & L1-LInf block norm: sum of L2 norms of rows. \\
\verb@prox_l1pos@ & L1 norm, restricted to $x \ge 0$ \\
Expand Down Expand Up @@ -1759,7 +1759,7 @@ \section{Appendix: list of TFOCS functions}
\multicolumn{2}{l}{\bf Premade solvers for specific problems (vector variables)}\\
\verb@solver_L1RLS@ & l1-regularized least squares problem, sometimes called the LASSO. \\
\verb@solver_LASSO@ & Minimize residual subject to l1-norm constraints. \\
\verb@solver_OrderedLASSO@ & Like LASSO but with an ordered l1 norm; see documentation. \\
\verb@solver_SLOPE@ & Sorted L One Penalized Estimation; like LASSO but with an ordered l1 norm; see documentation. \\
\verb@solver_sBP@ & Basis pursuit (l1-norm with equality constraints). Uses smoothing. \\
\verb@solver_sBPDN@ & Basis pursuit de-noising. BP with relaxed constraints. Uses smoothing. \\
\verb@solver_sBPDN_W@ & Weighted BPDN problem. Uses smoothing. \\
Expand Down

0 comments on commit 9bf1dfb

Please sign in to comment.