This repository contains code to solve non-negative least-squares problems of the form
using the accelerated projected gradient descent method with restart described here.
The matrix numpy.ndarray
or as scipy.sparse.linalg.LinearOperator
.
The latter is recommended for large-scale problems.
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)
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