NNLS

class NNLS(val maxIters: Int) extends SerializableLogging

NNLS solves nonnegative least squares problems using a modified projected gradient method.

Value Params
maxIters

user defined maximum iterations

Companion
object
trait Serializable
class Object
trait Matchable
class Any

Type members

Classlikes

case class State

Types

type BDM = DenseMatrix[Double]
type BDV = DenseVector[Double]

Value members

Concrete methods

def initialize(n: Int): State

Solve a least squares problem, possibly with nonnegativity constraints, by a modified projected gradient method. That is, find x minimising ||Ax - b||_2 given A^T A and A^T b.

Solve a least squares problem, possibly with nonnegativity constraints, by a modified projected gradient method. That is, find x minimising ||Ax - b||_2 given A^T A and A^T b.

We solve the problem min_x 1/2 x' ata x' - x'atb subject to x >= 0

The method used is similar to one described by Polyak (B. T. Polyak, The conjugate gradient method in extremal problems, Zh. Vychisl. Mat. Mat. Fiz. 9(4)(1969), pp. 94-112) for bound- constrained nonlinear programming. Polyak unconditionally uses a conjugate gradient direction, however, while this method only uses a conjugate gradient direction if the last iteration did not cause a previously-inactive constraint to become active.

def minimize(ata: DenseMatrix[Double], atb: DenseVector[Double]): DenseVector[Double]
def minimize(ata: DenseMatrix[Double], atb: DenseVector[Double], init: State): DenseVector[Double]
def minimizeAndReturnState(ata: DenseMatrix[Double], atb: DenseVector[Double], initialState: State, resetState: Boolean): State

minimizeAndReturnState allows users to hot start the solver using initialState. If a initialState is provided and resetState is set to false, the optimizer will hot start using the previous state. By default resetState is true and every time reset will be called on the incoming state

minimizeAndReturnState allows users to hot start the solver using initialState. If a initialState is provided and resetState is set to false, the optimizer will hot start using the previous state. By default resetState is true and every time reset will be called on the incoming state

Value Params
ata

gram matrix

atb

linear term

initialState

initial state for calling the solver from inner loops

resetState

reset the state based on the flag

Returns

converged state

def minimizeAndReturnState(ata: DenseMatrix[Double], atb: DenseVector[Double]): State
def reset(ata: DenseMatrix[Double], atb: DenseVector[Double], state: State): State

Inherited methods

protected def logger: LazyLogger
Inherited from
SerializableLogging

Concrete fields

val maxIters: Int