[ 
https://issues.apache.org/jira/browse/MAHOUT-1266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13687743#comment-13687743
 ] 

Martin Illecker commented on MAHOUT-1266:
-----------------------------------------

Thanks, I got your point about making two full passes. (including transpose() 
within the *times* method).

But if you do not execute A.transpose() within the method, you assume that A is 
transposed before?
Because the inner join of CompositeInputFormat will combine row by row and you 
want to have col by row, caused by A.transpose().

Sorry for my possible misunderstanding, but for me transposing A is missing.

Short example:

Matrix A:
|9.0|4.0|1.0|9.0| 
|1.0|8.0|6.0|3.0| 
|8.0|3.0|3.0|9.0| 
|7.0|1.0|9.0|6.0| 

Matrix B:
|2.0|1.0|6.0|5.0| 
|7.0|8.0|9.0|5.0| 
|2.0|1.0|5.0|8.0| 
|7.0|4.0|4.0|9.0|

The resulting matrix C computed by Mahout A.times(B) is wrong:

Matrix C:
|90.0|77.0|113.0|99.0| 
|53.0|75.0|88.0|66.0| 
|131.0|115.0|111.0|150.0|
|177.0|93.0|140.0|186.0|

If you assume that A is transposed before executing *times*, then 
MatrixMultiplicationJob is a little bit confusing.

Thanks!


                
> Two minor problems in DistributedRowMatrix using MatrixMultiplication
> ---------------------------------------------------------------------
>
>                 Key: MAHOUT-1266
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1266
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.7
>            Reporter: Martin Illecker
>            Priority: Trivial
>              Labels: newbie
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> Hello,
> I think I have found two minor problems in *DistributedRowMatrix*.
> In [1] the condition is wrong, because (l x m) * (m x n) = (l x n).
> The condition should be like in [2]. 
> And in *times*[3] the {{this.transpose()}} seems to be missing? (See [4])
> Do you have any benchmark results for Mahout MatrixMultiplication?
> Thanks!
> Martin
> [1] 
> [https://github.com/apache/mahout/blob/trunk/core/src/main/java/org/apache/mahout/math/hadoop/DistributedRowMatrix.java#L191-193]
> [2] 
> [https://github.com/millecker/applications/blob/master/hadoop/rootbeer/matrixmultiplication/src/at/illecker/hadoop/rootbeer/examples/matrixmultiplication/DistributedRowMatrix.java#L221-225]
> [3] 
> [https://github.com/apache/mahout/blob/trunk/core/src/main/java/org/apache/mahout/math/hadoop/DistributedRowMatrix.java#L190-206]
> [4] 
> [https://github.com/millecker/applications/blob/master/hadoop/rootbeer/matrixmultiplication/src/at/illecker/hadoop/rootbeer/examples/matrixmultiplication/DistributedRowMatrix.java#L230-231]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to