You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemml.apache.org by "Narayanaswami, Sandeep" <Sa...@capitalone.com> on 2016/06/17 23:12:30 UTC

Matrix indexing in PyDML

Hi folks,

I have only started to play around with SystemML. The documentation here (http://apache.github.io/incubator-systemml/beginners-guide-to-dml-and-pydml.html#creating-a-matrix) says that matrices are supposed to index from 1 in both DML and PyDML. However, the example code throws an error, clearly indicating out-of-bounds indices.

at org.apache.sysml.runtime.controlprogram.ForProgramBlock.execute(ForProgramBlock.java:186)
... 5 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Invalid values for matrix indexing: [2:2,4:4] must be within matrix dimensions [4,3]
at org.apache.sysml.runtime.matrix.data.MatrixBlock.sliceOperations(MatrixBlock.java:4033)
...

The PyDML language reference .doc on the other hand says indexing is 0-based in PyDML.

I was going to submit a PR to correct the Beginner's Guide, but I wanted to first check what the intent was.

Thanks for your help!


<http://apache.github.io/incubator-systemml/beginners-guide-to-dml-and-pydml.html#creating-a-matrix>
________________________________________________________

The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates and may only be used solely in performance of work or services for Capital One. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.

Re: Matrix indexing in PyDML

Posted by du...@gmail.com.
Hi Sandeep,

You are indeed correct that PyDML uses 0-based indexing (like Python), and that the beginner's guide is incorrect! Interestingly enough, we do have an open PR that addresses this, so it should be cleared up upon merging.

Thanks, and please feel free to continue posting questions or feedback here!


-Mike

--

Mike Dusenberry
GitHub: github.com/dusenberrymw
LinkedIn: linkedin.com/in/mikedusenberry

Sent from my iPhone.


> On Jun 17, 2016, at 4:12 PM, Narayanaswami, Sandeep <Sa...@capitalone.com> wrote:
> 
> Hi folks,
> 
> I have only started to play around with SystemML. The documentation here (http://apache.github.io/incubator-systemml/beginners-guide-to-dml-and-pydml.html#creating-a-matrix) says that matrices are supposed to index from 1 in both DML and PyDML. However, the example code throws an error, clearly indicating out-of-bounds indices.
> 
> at org.apache.sysml.runtime.controlprogram.ForProgramBlock.execute(ForProgramBlock.java:186)
> ... 5 more
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: Invalid values for matrix indexing: [2:2,4:4] must be within matrix dimensions [4,3]
> at org.apache.sysml.runtime.matrix.data.MatrixBlock.sliceOperations(MatrixBlock.java:4033)
> ...
> 
> The PyDML language reference .doc on the other hand says indexing is 0-based in PyDML.
> 
> I was going to submit a PR to correct the Beginner's Guide, but I wanted to first check what the intent was.
> 
> Thanks for your help!
> 
> 
> <http://apache.github.io/incubator-systemml/beginners-guide-to-dml-and-pydml.html#creating-a-matrix>
> ________________________________________________________
> 
> The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates and may only be used solely in performance of work or services for Capital One. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.