Hi Guys,

Could you please point to the JIRA for this ?

Why are we not doing NNMF using Breeze's constrained solver ? After
Xiangrui's sparse checkin we are trying to make use of the optimization
code that is available in breeze or extend upon it....

Breeze's constrained solver is also a projected gradient solver which uses
quasi newton matrix and it can handle bound constraints...I am not sure how
it works on more complex constraints but NNMF is a classic bound
constrained problem....

Thanks.
Deb



On Sun, Apr 20, 2014 at 10:42 PM, mengxr <[email protected]> wrote:

> Github user mengxr commented on a diff in the pull request:
>
>     https://github.com/apache/spark/pull/460#discussion_r11802315
>
>     --- Diff:
> mllib/src/main/scala/org/apache/spark/mllib/optimization/NNLSbyPCG.scala ---
>     @@ -0,0 +1,141 @@
>     +/*
>     + * Licensed to the Apache Software Foundation (ASF) under one or more
>     + * contributor license agreements.  See the NOTICE file distributed
> with
>     + * this work for additional information regarding copyright ownership.
>     + * The ASF licenses this file to You under the Apache License,
> Version 2.0
>     + * (the "License"); you may not use this file except in compliance
> with
>     + * the License.  You may obtain a copy of the License at
>     + *
>     + *    http://www.apache.org/licenses/LICENSE-2.0
>     + *
>     + * Unless required by applicable law or agreed to in writing, software
>     + * distributed under the License is distributed on an "AS IS" BASIS,
>     + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
>     + * See the License for the specific language governing permissions and
>     + * limitations under the License.
>     + */
>     +
>     +package org.apache.spark.mllib.optimization
>     +
>     +import org.jblas.{DoubleMatrix, SimpleBlas}
>     +import org.apache.spark.annotation.DeveloperApi
>     +
>     +/**
>     + * :: DeveloperApi ::
>     + * Object used to solve nonnegative least squares problems using a
> modified
>     + * projected gradient method.
>     + */
>     +@DeveloperApi
>     +object NNLSbyPCG {
>     +  /**
>     +   * 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.
>     +   */
>     +  def solve(ata: DoubleMatrix, atb: DoubleMatrix, nonnegative:
> Boolean): Array[Double] = {
>     +    val n = atb.rows
>     +    val scratch = new DoubleMatrix(n, 1)
>     +
>     +    // find the optimal unconstrained step
>     +    def steplen(dir: DoubleMatrix, resid: DoubleMatrix): Double = {
>     --- End diff --
>
>     `stepSize` or `stepLength`?
>
>
> ---
> If your project is set up for it, you can reply to this email and have your
> reply appear on GitHub as well. If your project does not have this feature
> enabled and wishes so, or if the feature is enabled but not working, please
> contact infrastructure at [email protected] or file a JIRA ticket
> with INFRA.
> ---
>

Reply via email to