You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/02/07 22:23:30 UTC
[GitHub] Sinnombre opened a new issue #9737: dot product backwards in R
Sinnombre opened a new issue #9737: dot product backwards in R
URL: https://github.com/apache/incubator-mxnet/issues/9737
## Description
When using R, the routine mx.nd.dot processes the inputs in the wrong order. See example below. A 1x3 vector dot a 3x1 vector should be a scalar, and a 3x1 dot 1x3 should be 3x3, not the other way around. I'm guessing this has to do with R being column major instead of row major.
## Environment info (Required)
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets
[6] methods base
other attached packages:
[1] mxnet_0.10.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.14 compiler_3.4.3
[3] RColorBrewer_1.1-2 influenceR_0.1.0
[5] plyr_1.8.4 bindr_0.1
[7] viridis_0.5.0 tools_3.4.3
[9] digest_0.6.12 jsonlite_1.5
[11] viridisLite_0.3.0 tibble_1.3.4
[13] gtable_0.2.0 rgexf_0.15.3
[15] pkgconfig_2.0.1 rlang_0.1.4
[17] igraph_1.1.2 rstudioapi_0.7
[19] bindrcpp_0.2 gridExtra_2.3
[21] downloader_0.4 DiagrammeR_0.9.2
[23] dplyr_0.7.4 stringr_1.2.0
[25] htmlwidgets_1.0 hms_0.4.1
[27] grid_3.4.3 glue_1.2.0
[29] R6_2.2.2 Rook_1.1-1
[31] XML_3.98-1.9 readr_1.1.1
[33] purrr_0.2.4 tidyr_0.8.0
[35] ggplot2_2.2.1 magrittr_1.5
[37] codetools_0.2-15 scales_0.5.0
[39] htmltools_0.3.6 assertthat_0.2.0
[41] colorspace_1.3-2 brew_1.0-6
[43] stringi_1.1.6 visNetwork_2.0.3
[45] lazyeval_0.2.1 munsell_0.4.3
## Error Message:
N/A
## Minimum reproducible example
> a <- mx.nd.ones(c(1,3), ctx = mx.cpu())
> b <- mx.nd.ones(c(3,1), ctx = mx.cpu())
> a
[,1] [,2] [,3]
[1,] 1 1 1
> b
[,1]
[1,] 1
[2,] 1
[3,] 1
> mx.nd.dot(a,b)
[,1] [,2] [,3]
[1,] 1 1 1
[2,] 1 1 1
[3,] 1 1 1
> mx.nd.dot(b,a)
[,1]
[1,] 3
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services