Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 974 Bytes

README.md

File metadata and controls

38 lines (27 loc) · 974 Bytes

matrix_free_nnls

This repository contains code to solve non-negative least-squares problems of the form

$$ \min_{x \geq 0} ||Ax - b||_2^2 $$

using the accelerated projected gradient descent method with restart described here.

The matrix $A$ can be provided by the user as numpy.ndarray or as scipy.sparse.linalg.LinearOperator. The latter is recommended for large-scale problems.

image

Usage

import numpy as np
from matrix_free_nnls import solve_nnls

a = np.random.randn(100, 100)
b = np.random.randn(100)

x, res = solve_nnls(a, b)

Installation

You can download the wheel file matrix_free_nnls-1.0-py3-none-any.whl and then pip-install:

pip install matrix_free_nnls-1.0-py3-none-any.whl