You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Dan Filimon <da...@gmail.com> on 2013/01/04 13:35:35 UTC

Performance of matrix/vector projections

Hi,

I'm playing around with using random projections for faster
nearest-neighbor searches.

Until now, I was projecting using a list of vectors rather than a
Matrix because MatrixSlices weren't vectors (although I'm looking to
change that).

Anyway, I've written a tiny non-scientific benchmark and I'm getting
unexpected results that I documented at [1].

It seems that using matrices is about 1.6 seconds slower on average
(with a std dev of 0.68s).

The code I used is here [2].

The thing that's bothering me is that a had an older version that
behaved totally different but I overwrote it and don't have it any
more. :(

Would you expect there to be any difference between these two ways of
projecting?

Thanks!

[1] https://github.com/dfilimon/knn/issues/12
[2] https://github.com/dfilimon/knn/blob/76e230830f4a90fb116634450fc58b99ebb75154/src/test/java/org/apache/mahout/knn/tools/ProjectionBenchmark.java

Re: Performance of matrix/vector projections

Posted by Jake Mannix <ja...@gmail.com>.
On Fri, Jan 4, 2013 at 4:35 AM, Dan Filimon <da...@gmail.com>wrote:

> Hi,
>
> I'm playing around with using random projections for faster
> nearest-neighbor searches.
>
> Until now, I was projecting using a list of vectors rather than a
> Matrix because MatrixSlices weren't vectors (although I'm looking to
> change that).
>

What do you mean by this?  MatrixSlice has a method to get the vector
from it, right?  It's really just a Pair<Integer, Vector>, after all.


>
> Anyway, I've written a tiny non-scientific benchmark and I'm getting
> unexpected results that I documented at [1].
>
> It seems that using matrices is about 1.6 seconds slower on average
> (with a std dev of 0.68s).
>

1.6 seconds slower doesn't say much, being an absolute number - what
you mean is that matrix multiplication is ~30% slower than by raw vectors,
which is certainly strange.


>
> The code I used is here [2].
>
> The thing that's bothering me is that a had an older version that
> behaved totally different but I overwrote it and don't have it any
> more. :(
>
> Would you expect there to be any difference between these two ways of
> projecting?
>
> Thanks!
>
> [1] https://github.com/dfilimon/knn/issues/12
> [2]
> https://github.com/dfilimon/knn/blob/76e230830f4a90fb116634450fc58b99ebb75154/src/test/java/org/apache/mahout/knn/tools/ProjectionBenchmark.java
>



-- 

  -jake

Re: Performance of matrix/vector projections

Posted by Dan Filimon <da...@gmail.com>.
Thanks! I found it.
I'll see how it compares with this one. :)

On Fri, Jan 4, 2013 at 6:05 PM, Ted Dunning <te...@gmail.com> wrote:
> Have you looked at IntelliJ's local history?
>
> On Fri, Jan 4, 2013 at 4:35 AM, Dan Filimon <da...@gmail.com>wrote:
>
>> The thing that's bothering me is that a had an older version that
>> behaved totally different but I overwrote it and don't have it any
>> more. :(
>>

Re: Performance of matrix/vector projections

Posted by Ted Dunning <te...@gmail.com>.
Have you looked at IntelliJ's local history?

On Fri, Jan 4, 2013 at 4:35 AM, Dan Filimon <da...@gmail.com>wrote:

> The thing that's bothering me is that a had an older version that
> behaved totally different but I overwrote it and don't have it any
> more. :(
>