On Thu, Apr 28, 2011 at 12:32 AM, Jonathan Traupman
<[email protected]>wrote:

> I'm working on the LinearOperator stuff for MAHOUT-672 and have gotten to
> the point when I'm modifying the new LanczosSolver as implemented in the
> MAHOUT-319 patch applied to Jake's github repo.
>
> One quick question: on lines 165-167 of LanczosSolver.java we have the
> lines:
>
> if (isSymmetric) {
>  e = Math.sqrt(e);
> }
>
> Unless I'm misunderstanding something, isn't this backwards? My
> understanding is that Lanczos is an eigendecomposition algorithm, so for a
> symmetric A, it's going to compute eigenvector matrix U and diagonal
> eigenvalue matrix S such that A ~= USU'. To use it to compute the SVD, you
> use the fact that for non-symmetric A = USV', we have A'A = V(S^2)V', so by
> taking the eigendecomposition of A'A, you get the right singular vectors as
> the eigenvectors and the singular values as the sqrt of the eigenvalues.
> So,
> shouldn't these lines be:
>
> if (!isSymmetric) {
>  e = Math.sqrt(e);
> }
>
>
You're probably correct here.  I thought there was a unit test in
LanczosSolverTest
which compared eigenvalues to that of using the old COLT Eigendecomposition
class, like "testEigenvalue()" or something like that?  I may have written
that test
wrong, and then convinced myself I had to make the test pass... :\

It's too bad you're having to spend *both* your work hours, *and* your open
source
contributions fixing dumb bugs of my code.  :(

  -jake

Reply via email to