mahout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitriy Lyubimov <dlie...@gmail.com>
Subject Re: Cholesky troubles again.
Date Thu, 06 Mar 2014 03:04:35 GMT
well the positive definite test is failing starting with row 2.  I stepped
thru it. But i am at loss why.


On Wed, Mar 5, 2014 at 6:55 PM, Andrew Musselman <andrew.musselman@gmail.com
> wrote:

> Just noticed it looks like some kind of rounding error since rows "2" and
> "3" in rControl have very small values in their elements.
>
>
> On Wed, Mar 5, 2014 at 6:48 PM, Dmitriy Lyubimov <dlieu.7@gmail.com>
> wrote:
>
> > Hi,
> >
> > I am trying to put in Cholesky-based distributed thin QR and having
> > troubles again (even with in-core). What am i doing wrong? I am inclined
> to
> > think there's definitely a bug in our Cholesky implementation, at this
> > point.
> >
> > Here is the test code -- obviously results are different via Householder
> QR
> > and via Cholesky. Note that two rows of L' (R) matrix match the result
> > exactly, and it looks like L is just loosing two of its columns somehow.
> >
> > Could somebody perhaps review the CholeskyDecomposition in Mahout?
> Because
> > of this, tests in spark - QR and spark -SSVD are failing.
> >
> > here's the code for in-core only and output:
> >
> > -----------------
> >
> >     val inCoreA = dense(
> >       (1, 2, 3, 40),
> >       (2, 3, 4, 50),
> >       (3, 4, 5, 60),
> >       (4, 5, 6, 70),
> >       (5, 6, 7, 80)
> >     )
> >
> >     val (qControl, rControl) = qr(inCoreA)
> >
> >     printf("qControl=\n%s\n", qControl)
> >     printf("rControl=\n%s\n", rControl)
> >
> >     // Validate with Cholesky
> >     val ch = chol(inCoreA.t %*% inCoreA)
> >     val rControl2 = (ch.getL cloned).t
> >     val qControl2 = ch.solveRight(inCoreA)
> >
> >     printf("qControl2=\n%s\n", qControl2)
> >     printf("rControl2=\n%s\n", rControl2)
> >
> >
> >
> > qControl=
> > {
> >   0  =>
> >
> >
> {0:0.13483997249264842,1:0.7627700713964736,2:0.09950371902099892,3:-0.30053573339989126}
> >   1  =>
> >
> >
> {0:0.26967994498529685,1:0.4767312946227957,2:0.19900743804199783,3:0.34749444174362476}
> >   2  =>
> >
> >
> {0:0.40451991747794525,1:0.1906925178491178,2:0.39801487608399566,3:0.22070592921554588}
> >   3  =>
> >
> >
> {0:0.5393598899705937,1:-0.09534625892456007,2:0.39801487608399566,3:0.6949888834872495}
> >   4  =>
> >
> >
> {0:0.6741998624632421,1:-0.3813850356982384,2:0.7960297521679913,3:-0.5071540501123155}
> > }
> > rControl=
> > {
> >   0  =>
> >
> >
> {0:7.416198487095663,1:9.43879807448539,2:11.461397661875116,3:134.83997249264843}
> >   1  => {1:0.9534625892455925,2:1.906925178491185,3:28.603877677367773}
> >   2  => {2:2.2315206618374916E-15,3:4.1360462167918654E-14}
> >   3  => {3:1.8726762404185252E-15}
> > }
> > L:
> > {
> >   0  => {0:7.416198487095663}
> >   1  => {0:9.43879807448539,1:0.953462589245576}
> >   2  => {0:11.461397661875116,1:1.9069251784911967}
> >   3  => {0:134.83997249264843,1:28.603877677367997}
> > }
> > qControl2=
> > {
> >   0  => {0:0.13483997249264842,1:0.7627700713964867}
> >   1  => {0:0.26967994498529685,1:0.4767312946228039}
> >   2  => {0:0.40451991747794525,1:0.19069251784912108}
> >   3  => {0:0.5393598899705937,1:-0.09534625892456171}
> >   4  => {0:0.674199862463242,1:-0.38138503569824406}
> > }
> > rControl2=
> > {
> >   0  =>
> >
> >
> {0:7.416198487095663,1:9.43879807448539,2:11.461397661875116,3:134.83997249264843}
> >   1  => {1:0.953462589245576,2:1.9069251784911967,3:28.603877677367997}
> >   2  => {}
> >   3  => {}
> > }
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message