SParse Optimization Research COde (SPORCO) is a Python package for solving optimisation problems with sparsity-inducing regularisation . These consist primarily of sparse coding  and dictionary learning  problems, including convolutional sparse coding and dictionary learning , but there is also support for other problems such as Total Variation regularisation  , Robust PCA , and Plug and Play Priors . The optimisation algorithms in the current version are based on the Alternating Direction Method of Multipliers (ADMM)  or on the Fast Iterative Shrinkage-Thresholding Algorithm (FISTA) .
In addition to this documentation, an overview of the design and functionality of SPORCO is also available in .
GPU accelerated versions of some of the SPORCO solvers are provided within the
sporco.cupy subpackages. Use of the former requires installation of the SPORCO-CUDA extension package, while the latter requires installation of CuPy . The
sporco.cupy subpackage supports a much wider range of problems than
sporco.cuda, which only supports four different variants of convolutional sparse coding. However, the
sporco.cuda functions are substantially faster than the corresponding functions in
sporco.cupy since those in
sporco.cuda are implemented directly in CUDA, while those in
sporco.cupy use CuPy as a replacement for NumPy.
Usage examples are available as Python scripts and Jupyter Notebooks.
A large collection of scripts illustrating usage of the package can be found in the
examples directory of the source distribution. These examples can be run from the root directory of the package by, for example
To run these scripts prior to installing the package it will be necessary to first set the
PYTHONPATH environment variable to include the root directory of the package. For example, in a
from the root directory of the package, or in a Windows Command Prompt shell
If SPORCO has been installed via
pip, the examples can be found in the directory in which
pip installs documentation, e.g.
If you use this library for published work, please cite  or  (see bibtex entries
docs/source/references.bib in the source distribution). If you use of any of the convolutional sparse representation classes, please also cite any other papers relevant to the specific functionality that is used, e.g. , , , , .
This package was developed at Los Alamos National Laboratory, and has been approved for public release under the approval number LA-CC-14-057. It is made available under the terms of the BSD 3-Clause License (see the LICENSE file for details).
This package was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of Energy/National Nuclear Security Administration. All rights in the program are reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear Security Administration. The Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. If this software is modified to produce derivative works, such modified software should be clearly marked, so as not to confuse it with the version available from LANL.