You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Dmitriy Lyubimov <dl...@gmail.com> on 2013/07/10 20:59:36 UTC

EigenDecomposition

It looks like values out of our ported EigenDecomposition are coming out
sorted in inverse order.

Shouldn't it be the other way around?

Re: EigenDecomposition

Posted by Ted Dunning <te...@gmail.com>.
Weekend is coming.


On Thu, Jul 11, 2013 at 11:07 AM, Grant Ingersoll <gs...@apache.org>wrote:

> FWIW, the only way we are getting out of code freeze is if we actually get
> some feedback on the RC.  It passes my tests, but I haven't heard from
> others much.
>
> -Grant
>
> On Jul 10, 2013, at 5:13 PM, Dmitriy Lyubimov <dl...@gmail.com> wrote:
>
> > meant, after code freeze is over.
> >
> >
> > On Wed, Jul 10, 2013 at 2:13 PM, Dmitriy Lyubimov <dl...@gmail.com>
> wrote:
> >
> >> fixed as part of MAHOUT-1281 patch now. I will push after code freeze.
> >>
> >>
> >> On Wed, Jul 10, 2013 at 2:06 PM, Ted Dunning <ted.dunning@gmail.com
> >wrote:
> >>
> >>> Please file.  Looks completely innocuous and it is good to be standard.
> >>>
> >>>
> >>> On Wed, Jul 10, 2013 at 12:59 PM, Dmitriy Lyubimov <dlieu.7@gmail.com
> >>>> wrote:
> >>>
> >>>> Looks like Lanczos is having the same problem and need to undo some
> >>>> workarounds :
> >>>>
> >>>>    EigenDecomposition decomp = new EigenDecomposition(triDiag);
> >>>>
> >>>>    Matrix eigenVects = decomp.getV();
> >>>>    Vector eigenVals = decomp.getRealEigenvalues();
> >>>>    endTime(TimingSection.TRIDIAG_DECOMP);
> >>>>    startTime(TimingSection.FINAL_EIGEN_CREATE);
> >>>>    for (int row = 0; row < i; row++) {
> >>>>      Vector realEigen = null;
> >>>>      // the eigenvectors live as columns of V, in reverse order.
>  Weird
> >>>> but true.
> >>>>      Vector ejCol = eigenVects.viewColumn(i - row - 1);
> >>>>      int size = Math.min(ejCol.size(), state.getBasisSize());
> >>>>
> >>>>
> >>>>
> >>>> On Wed, Jul 10, 2013 at 12:53 PM, Dmitriy Lyubimov <dlieu.7@gmail.com
> >>>>> wrote:
> >>>>
> >>>>> changing line 329 of EigenDecomposition.java from
> >>>>>
> >>>>>        if (d.getQuick(j) < p) {
> >>>>>
> >>>>> to
> >>>>>        if (d.getQuick(j) > p) {
> >>>>>
> >>>>>
> >>>>> makes my MAHOUT-1281 patch work.
> >>>>>
> >>>>> should i keep the change? (question for Ted, i guess)
> >>>>>
> >>>>> thanks.
> >>>>> -D
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Wed, Jul 10, 2013 at 11:59 AM, Dmitriy Lyubimov <
> dlieu.7@gmail.com
> >>>>> wrote:
> >>>>>
> >>>>>> It looks like values out of our ported EigenDecomposition are coming
> >>> out
> >>>>>> sorted in inverse order.
> >>>>>>
> >>>>>> Shouldn't it be the other way around?
> >>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>
> >>
> >>
>
> --------------------------------------------
> Grant Ingersoll | @gsingers
> http://www.lucidworks.com
>
>
>
>
>
>

Re: EigenDecomposition

Posted by Grant Ingersoll <gs...@apache.org>.
FWIW, the only way we are getting out of code freeze is if we actually get some feedback on the RC.  It passes my tests, but I haven't heard from others much.

-Grant

On Jul 10, 2013, at 5:13 PM, Dmitriy Lyubimov <dl...@gmail.com> wrote:

> meant, after code freeze is over.
> 
> 
> On Wed, Jul 10, 2013 at 2:13 PM, Dmitriy Lyubimov <dl...@gmail.com> wrote:
> 
>> fixed as part of MAHOUT-1281 patch now. I will push after code freeze.
>> 
>> 
>> On Wed, Jul 10, 2013 at 2:06 PM, Ted Dunning <te...@gmail.com>wrote:
>> 
>>> Please file.  Looks completely innocuous and it is good to be standard.
>>> 
>>> 
>>> On Wed, Jul 10, 2013 at 12:59 PM, Dmitriy Lyubimov <dlieu.7@gmail.com
>>>> wrote:
>>> 
>>>> Looks like Lanczos is having the same problem and need to undo some
>>>> workarounds :
>>>> 
>>>>    EigenDecomposition decomp = new EigenDecomposition(triDiag);
>>>> 
>>>>    Matrix eigenVects = decomp.getV();
>>>>    Vector eigenVals = decomp.getRealEigenvalues();
>>>>    endTime(TimingSection.TRIDIAG_DECOMP);
>>>>    startTime(TimingSection.FINAL_EIGEN_CREATE);
>>>>    for (int row = 0; row < i; row++) {
>>>>      Vector realEigen = null;
>>>>      // the eigenvectors live as columns of V, in reverse order.  Weird
>>>> but true.
>>>>      Vector ejCol = eigenVects.viewColumn(i - row - 1);
>>>>      int size = Math.min(ejCol.size(), state.getBasisSize());
>>>> 
>>>> 
>>>> 
>>>> On Wed, Jul 10, 2013 at 12:53 PM, Dmitriy Lyubimov <dlieu.7@gmail.com
>>>>> wrote:
>>>> 
>>>>> changing line 329 of EigenDecomposition.java from
>>>>> 
>>>>>        if (d.getQuick(j) < p) {
>>>>> 
>>>>> to
>>>>>        if (d.getQuick(j) > p) {
>>>>> 
>>>>> 
>>>>> makes my MAHOUT-1281 patch work.
>>>>> 
>>>>> should i keep the change? (question for Ted, i guess)
>>>>> 
>>>>> thanks.
>>>>> -D
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On Wed, Jul 10, 2013 at 11:59 AM, Dmitriy Lyubimov <dlieu.7@gmail.com
>>>>> wrote:
>>>>> 
>>>>>> It looks like values out of our ported EigenDecomposition are coming
>>> out
>>>>>> sorted in inverse order.
>>>>>> 
>>>>>> Shouldn't it be the other way around?
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>> 
>> 
>> 

--------------------------------------------
Grant Ingersoll | @gsingers
http://www.lucidworks.com






Re: EigenDecomposition

Posted by Dmitriy Lyubimov <dl...@gmail.com>.
meant, after code freeze is over.


On Wed, Jul 10, 2013 at 2:13 PM, Dmitriy Lyubimov <dl...@gmail.com> wrote:

> fixed as part of MAHOUT-1281 patch now. I will push after code freeze.
>
>
> On Wed, Jul 10, 2013 at 2:06 PM, Ted Dunning <te...@gmail.com>wrote:
>
>> Please file.  Looks completely innocuous and it is good to be standard.
>>
>>
>> On Wed, Jul 10, 2013 at 12:59 PM, Dmitriy Lyubimov <dlieu.7@gmail.com
>> >wrote:
>>
>> > Looks like Lanczos is having the same problem and need to undo some
>> > workarounds :
>> >
>> >     EigenDecomposition decomp = new EigenDecomposition(triDiag);
>> >
>> >     Matrix eigenVects = decomp.getV();
>> >     Vector eigenVals = decomp.getRealEigenvalues();
>> >     endTime(TimingSection.TRIDIAG_DECOMP);
>> >     startTime(TimingSection.FINAL_EIGEN_CREATE);
>> >     for (int row = 0; row < i; row++) {
>> >       Vector realEigen = null;
>> >       // the eigenvectors live as columns of V, in reverse order.  Weird
>> > but true.
>> >       Vector ejCol = eigenVects.viewColumn(i - row - 1);
>> >       int size = Math.min(ejCol.size(), state.getBasisSize());
>> >
>> >
>> >
>> > On Wed, Jul 10, 2013 at 12:53 PM, Dmitriy Lyubimov <dlieu.7@gmail.com
>> > >wrote:
>> >
>> > > changing line 329 of EigenDecomposition.java from
>> > >
>> > >         if (d.getQuick(j) < p) {
>> > >
>> > > to
>> > >         if (d.getQuick(j) > p) {
>> > >
>> > >
>> > > makes my MAHOUT-1281 patch work.
>> > >
>> > > should i keep the change? (question for Ted, i guess)
>> > >
>> > > thanks.
>> > > -D
>> > >
>> > >
>> > >
>> > >
>> > > On Wed, Jul 10, 2013 at 11:59 AM, Dmitriy Lyubimov <dlieu.7@gmail.com
>> > >wrote:
>> > >
>> > >> It looks like values out of our ported EigenDecomposition are coming
>> out
>> > >> sorted in inverse order.
>> > >>
>> > >> Shouldn't it be the other way around?
>> > >>
>> > >
>> > >
>> >
>>
>
>

Re: EigenDecomposition

Posted by Dmitriy Lyubimov <dl...@gmail.com>.
fixed as part of MAHOUT-1281 patch now. I will push after code freeze.


On Wed, Jul 10, 2013 at 2:06 PM, Ted Dunning <te...@gmail.com> wrote:

> Please file.  Looks completely innocuous and it is good to be standard.
>
>
> On Wed, Jul 10, 2013 at 12:59 PM, Dmitriy Lyubimov <dlieu.7@gmail.com
> >wrote:
>
> > Looks like Lanczos is having the same problem and need to undo some
> > workarounds :
> >
> >     EigenDecomposition decomp = new EigenDecomposition(triDiag);
> >
> >     Matrix eigenVects = decomp.getV();
> >     Vector eigenVals = decomp.getRealEigenvalues();
> >     endTime(TimingSection.TRIDIAG_DECOMP);
> >     startTime(TimingSection.FINAL_EIGEN_CREATE);
> >     for (int row = 0; row < i; row++) {
> >       Vector realEigen = null;
> >       // the eigenvectors live as columns of V, in reverse order.  Weird
> > but true.
> >       Vector ejCol = eigenVects.viewColumn(i - row - 1);
> >       int size = Math.min(ejCol.size(), state.getBasisSize());
> >
> >
> >
> > On Wed, Jul 10, 2013 at 12:53 PM, Dmitriy Lyubimov <dlieu.7@gmail.com
> > >wrote:
> >
> > > changing line 329 of EigenDecomposition.java from
> > >
> > >         if (d.getQuick(j) < p) {
> > >
> > > to
> > >         if (d.getQuick(j) > p) {
> > >
> > >
> > > makes my MAHOUT-1281 patch work.
> > >
> > > should i keep the change? (question for Ted, i guess)
> > >
> > > thanks.
> > > -D
> > >
> > >
> > >
> > >
> > > On Wed, Jul 10, 2013 at 11:59 AM, Dmitriy Lyubimov <dlieu.7@gmail.com
> > >wrote:
> > >
> > >> It looks like values out of our ported EigenDecomposition are coming
> out
> > >> sorted in inverse order.
> > >>
> > >> Shouldn't it be the other way around?
> > >>
> > >
> > >
> >
>

Re: EigenDecomposition

Posted by Ted Dunning <te...@gmail.com>.
Please file.  Looks completely innocuous and it is good to be standard.


On Wed, Jul 10, 2013 at 12:59 PM, Dmitriy Lyubimov <dl...@gmail.com>wrote:

> Looks like Lanczos is having the same problem and need to undo some
> workarounds :
>
>     EigenDecomposition decomp = new EigenDecomposition(triDiag);
>
>     Matrix eigenVects = decomp.getV();
>     Vector eigenVals = decomp.getRealEigenvalues();
>     endTime(TimingSection.TRIDIAG_DECOMP);
>     startTime(TimingSection.FINAL_EIGEN_CREATE);
>     for (int row = 0; row < i; row++) {
>       Vector realEigen = null;
>       // the eigenvectors live as columns of V, in reverse order.  Weird
> but true.
>       Vector ejCol = eigenVects.viewColumn(i - row - 1);
>       int size = Math.min(ejCol.size(), state.getBasisSize());
>
>
>
> On Wed, Jul 10, 2013 at 12:53 PM, Dmitriy Lyubimov <dlieu.7@gmail.com
> >wrote:
>
> > changing line 329 of EigenDecomposition.java from
> >
> >         if (d.getQuick(j) < p) {
> >
> > to
> >         if (d.getQuick(j) > p) {
> >
> >
> > makes my MAHOUT-1281 patch work.
> >
> > should i keep the change? (question for Ted, i guess)
> >
> > thanks.
> > -D
> >
> >
> >
> >
> > On Wed, Jul 10, 2013 at 11:59 AM, Dmitriy Lyubimov <dlieu.7@gmail.com
> >wrote:
> >
> >> It looks like values out of our ported EigenDecomposition are coming out
> >> sorted in inverse order.
> >>
> >> Shouldn't it be the other way around?
> >>
> >
> >
>

Re: EigenDecomposition

Posted by Dmitriy Lyubimov <dl...@gmail.com>.
Looks like Lanczos is having the same problem and need to undo some
workarounds :

    EigenDecomposition decomp = new EigenDecomposition(triDiag);

    Matrix eigenVects = decomp.getV();
    Vector eigenVals = decomp.getRealEigenvalues();
    endTime(TimingSection.TRIDIAG_DECOMP);
    startTime(TimingSection.FINAL_EIGEN_CREATE);
    for (int row = 0; row < i; row++) {
      Vector realEigen = null;
      // the eigenvectors live as columns of V, in reverse order.  Weird
but true.
      Vector ejCol = eigenVects.viewColumn(i - row - 1);
      int size = Math.min(ejCol.size(), state.getBasisSize());



On Wed, Jul 10, 2013 at 12:53 PM, Dmitriy Lyubimov <dl...@gmail.com>wrote:

> changing line 329 of EigenDecomposition.java from
>
>         if (d.getQuick(j) < p) {
>
> to
>         if (d.getQuick(j) > p) {
>
>
> makes my MAHOUT-1281 patch work.
>
> should i keep the change? (question for Ted, i guess)
>
> thanks.
> -D
>
>
>
>
> On Wed, Jul 10, 2013 at 11:59 AM, Dmitriy Lyubimov <dl...@gmail.com>wrote:
>
>> It looks like values out of our ported EigenDecomposition are coming out
>> sorted in inverse order.
>>
>> Shouldn't it be the other way around?
>>
>
>

Re: EigenDecomposition

Posted by Dmitriy Lyubimov <dl...@gmail.com>.
changing line 329 of EigenDecomposition.java from

        if (d.getQuick(j) < p) {

to
        if (d.getQuick(j) > p) {


makes my MAHOUT-1281 patch work.

should i keep the change? (question for Ted, i guess)

thanks.
-D




On Wed, Jul 10, 2013 at 11:59 AM, Dmitriy Lyubimov <dl...@gmail.com>wrote:

> It looks like values out of our ported EigenDecomposition are coming out
> sorted in inverse order.
>
> Shouldn't it be the other way around?
>