Introduction

## 1 Introduction

SPAMS (SPArse Modeling Software) is an open-source optimization toolbox under licence GPLv3. It implements algorithms for solving various machine learning and signal processing problems involving sparse regularizations.

The library is coded in C++, is compatible with Linux, Mac, and Windows 32bits and 64bits Operating Systems. It is interfaced with Matlab, but can be called from any C++ application. A R and Python interface has been developed by Jean-Paul Chieze.

It requires an implementation of BLAS and LAPACK for performing efficient linear algebra operations such as the one provided by matlab/R, atlas, netlib, or the one provided by Intel (Math Kernel Library). It also exploits multi-core CPUs when this feature is supported by the compiler, through OpenMP.

The current licence is GPLv3 available at `http://www.gnu.org/licenses/gpl.html`, which limits its usage. For other usages (such as the use in proprietary softwares), please contact the author.

Version 2.3 of SPAMS is divided into three “toolboxes” and has a few additional miscellaneous functions:

- The Dictionary learning and matrix factorization toolbox contains the online learning technique of [19, 20] and its variants for solving various matrix factorization problems:
  - dictionary Learning for sparse coding;
  - sparse principal component analysis (seen as a sparse matrix factorization problem);
  - non-negative matrix factorization;
  - non-negative sparse coding.
- The Sparse decomposition toolbox contains efficient implementations of
  - Orthogonal Matching Pursuit, (or Forward Selection) [32, 24];
  - the LARS/homotopy algorithm [27, 8] (variants for solving Lasso and Elastic-Net problems);
  - a weighted version of LARS;
  - OMP and LARS when data come with a binary mask;
  - a coordinate-descent algorithm for ℓ1-decomposition problems [11, 9, 33];
  - a greedy solver for simultaneous signal approximation as defined in [31, 30] (SOMP);
  - a solver for simulatneous signal approximation with ℓ1/ℓ2-regularization based on block-coordinate descent;
  - a homotopy method for the Fused-Lasso Signal Approximation as defined in [9] with the homotopy method presented in the appendix of [20];
  - a tool for projecting efficiently onto a few convex sets inducing sparsity such as the ℓ1-ball using the method of [3, 17, 7], and Elastic-Net or Fused Lasso constraint sets as proposed in the appendix of [20].
- The Proximal toolbox: An implementation of proximal methods (ISTA and FISTA [1]) for solving a large class of sparse approximation problems with different combinations of loss and regularizations. One of the main features of this toolbox is to provide a robust stopping criterion based on duality gaps to control the quality of the optimization, whenever possible. It also handles sparse feature matrices for large-scale problems. The following regularizations are implemented:
  - Tikhonov regularization (squared ℓ2-norm);
  - ℓ1-norm, ℓ2, ℓ∞-norms;
  - Elastic-Net [35];
  - Fused Lasso [29];
  - tree-structured sum of ℓ2-norms (see [14, 15]);
  - tree-structured sum of ℓ∞-norms (see [14, 15]);
  - general sum of ℓ∞-norms (see [21, 22]);
  - mixed ℓ1/ℓ2-norms on matrices [34, 26];
  - mixed ℓ1/ℓ∞-norms on matrices [34, 26];
  - mixed ℓ1/ℓ2-norms on matrices plus ℓ1 [28, 10];
  - mixed ℓ1/ℓ∞-norms on matrices plus ℓ1;
  - group-lasso with ℓ2 or ℓ∞-norms;
  - group-lasso+ℓ1;
  - multi-task tree-structured sum of ℓ∞-norms (see [21, 22]);
  - trace norm;
  - ℓ0 pseudo-norm (only with ISTA);
  - tree-structured ℓ0 (only with ISTA);
  - rank regularization for matrices (only with ISTA);
  - the path-coding penalties of [23].
  All of these regularization functions can be used with the following losses
  - square loss;
  - square loss with missing observations;
  - logistic loss, weighted logistic loss;
  - multi-class logistic.
  This toolbox can also enforce non-negativity constraints, handle intercepts and sparse matrices. There are also a few additional undocumented functionalities, which are available in the source code.
- A few tools for performing linear algebra operations such as a conjugate gradient algorithm, manipulating sparse matrices and graphs.

The toolbox was written by Julien Mairal when he was at INRIA, with the collaboration of Francis Bach (INRIA), Jean Ponce (Ecole Normale Supérieure), Guillermo Sapiro (University of Minnesota), Guillaume Obozinski (INRIA) and Rodolphe Jenatton (INRIA).

R and Python interfaces have been written by Jean-Paul Chieze (INRIA), and a few contributors have helped us making compilation scripts for various platforms.