[GitHub] szha commented on issue #7304: gluon bce loss

2017-08-09 Thread git
szha commented on issue #7304: gluon bce loss
URL: https://github.com/apache/incubator-mxnet/pull/7304#issuecomment-321144365
 
 
   Updating the interface now for potential integration with cudnn7. Do not 
merge yet.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] idealboy commented on issue #7412: About van when using distribute training

2017-08-09 Thread git
idealboy commented on issue #7412: About van when using distribute training
URL: 
https://github.com/apache/incubator-mxnet/issues/7412#issuecomment-321456391
 
 
   my environment setting about mxnet dist-sync on two machines are below, two 
machines are ssh-able:
   
   (1)10.15.240.189:
   
   export DMLC_NUM_WORKER=1
   export MXNET_GPU_WORKER_NTHREADS=8
   export MXNET_CPU_WORKER_NTHREADS=8
   export MXNET_CPU_PRIORITY_NTHREADS=8
   export MXNET_GPU_COPY_NTHREADS=2
   export DMLC_NUM_SERVER=1
   export DMLC_PS_ROOT_URI=10.15.240.189
   export DMLC_PS_ROOT_PORT=3000
   export DMLC_ROLE=scheduler
   export DMLC_INTERFACE="eth0"
   
   (2)10.155.133.82
   export DMLC_ROLE=worker
   export DMLC_WORKER_NUM=1
   export DMLC_SERVER_NUM=1
   export DMLC_PS_ROOT_URI=10.15.240.189
   export DMLC_PS_ROOT_PORT=8000
   export DMLC_ROLE=worker
   export DMLC_INTERFACE="eth0"
   
   
   my program is:
   python ../../tools/launch.py -n 2 -H hosts --sync-dst-dir /tmp/mxnet
python train_mnist.py --network lenet --gpus 0 --kv-store dist_sync
   
   
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] idealboy commented on issue #7396: **********!!!Error with dist-sync on two machines, Thank you

2017-08-09 Thread git
idealboy commented on issue #7396: **!!!Error with dist-sync on two 
machines, Thank you
URL: 
https://github.com/apache/incubator-mxnet/issues/7396#issuecomment-321455058
 
 
   thr program is looping in van.cc:Start function  when mx.kvstore.create
   
   while(!ready_){ LOG(INFO) << "wait ready"}
   
   why ?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] CodingCat opened a new pull request #7411: [scala-package][spark] fix example script

2017-08-09 Thread git
CodingCat opened a new pull request #7411: [scala-package][spark] fix example 
script
URL: https://github.com/apache/incubator-mxnet/pull/7411
 
 
   I think it has been broken for a while
   
   and this is one of the fixes which I am bringing to spark module
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ykim362 commented on issue #7264: gluon conv rnns

2017-08-09 Thread git
ykim362 commented on issue #7264: gluon conv rnns
URL: https://github.com/apache/incubator-mxnet/pull/7264#issuecomment-321448378
 
 
   @szha I am sorry for late reply. I am out of office this week. MKL's concat 
does not support general dimensions. I might need to change the MXNet-MKL 
integration code so that the CPU code call the default library when MKL doesn't 
support the specific dimensions. I will do that when I return to the office 
next week.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong closed pull request #7405: Fix two typos in autograd.md

2017-08-09 Thread git
piiswrong closed pull request #7405: Fix two typos in autograd.md
URL: https://github.com/apache/incubator-mxnet/pull/7405
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet] branch master updated: Update autograd.md (#7405)

2017-08-09 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new 46039c3  Update autograd.md (#7405)
46039c3 is described below

commit 46039c34e13191c98020c6f046a197b262de9f72
Author: Zack Chase Lipton 
AuthorDate: Wed Aug 9 20:15:19 2017 -0700

Update autograd.md (#7405)

Fixing two typos that snuck into this doc. Thanks @fhieber for the careful 
eyes!
---
 docs/api/python/autograd.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/docs/api/python/autograd.md b/docs/api/python/autograd.md
index 5c84964..444e01f 100644
--- a/docs/api/python/autograd.md
+++ b/docs/api/python/autograd.md
@@ -34,6 +34,7 @@ and do some computation. Finally, call `backward()` on the 
result:
 >>> x.attach_grad()
 >>> with mx.autograd.record():
 ... y = x * x + 1
+>>> y.backward()
 >>> print(x.grad)
 [ 2.  4.  6.  8.]
 
@@ -44,7 +45,7 @@ and do some computation. Finally, call `backward()` on the 
result:
 
 Some operators (Dropout, BatchNorm, etc) behave differently in
 when training and when making predictions.
-This can be controled with `train_mode` and `predict_mode` scope.
+This can be controlled with `train_mode` and `predict_mode` scope.
 
 By default, MXNet is in `predict_mode`.
 A `with autograd.record()` block by default turns on `train_mode`

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" '].


[GitHub] leezu opened a new issue #7410: mxnet random seed should not be fixed by default

2017-08-09 Thread git
leezu opened a new issue #7410: mxnet random seed should not be fixed by default
URL: https://github.com/apache/incubator-mxnet/issues/7410
 
 
   mxnet seems to use a fixed seed for its random number generator. This is not 
good. To make sure research results are valid, experiments need to be repeated 
with different random initializations. To the best of my knowledge it is common 
practice that the seed for the random number generator is chosen by default 
randomly at startup. At least that is the behaviour of numpy.
   
   Compare what happens when running the following two files repeatedly:
   ```
   ?  ~ cat nprandom.py 
   import numpy as np
   print(np.random.normal(size=(2,2)))
   ?  ~ cat mxrandom.py 
   import mxnet as mx
   print(mx.nd.random_normal(shape=(2,2)))
   ```
   ```
   ?  ~ python3 nprandom.py
   [[ 0.07005017 -0.10707515]
[ 0.99219416  0.16670986]]
   ?  ~ python3 nprandom.py
   [[ 1.2185212  -1.56751472]
[ 1.14549379 -1.90969064]]
   ```
   
   ```
   ?  ~ python3 mxrandom.py
   
   [[ 2.21220636  1.16307867]
[ 0.7740038   0.48380461]]
   
   ?  ~ python3 mxrandom.py
   
   [[ 2.21220636  1.16307867]
[ 0.7740038   0.48380461]]
   
   ```
   
   I.e. mxnet random number generator uses the same seed..
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] kobenaxie opened a new issue #7409: How to implement NG(nonlinearity generator) activate function in mxnet?

2017-08-09 Thread git
kobenaxie opened a new issue #7409: How to implement NG(nonlinearity generator) 
activate function in mxnet?
URL: https://github.com/apache/incubator-mxnet/issues/7409
 
 
   For bugs or installation issues, please provide the following information.
   The more information you provide, the more likely people will be able to 
help you.
   
   ## Environment info
   Operating System:
   
   Compiler:
   
   Package used (Python/R/Scala/Julia):
   
   MXNet version:
   
   Or if installed from source:
   
   MXNet commit hash (`git rev-parse HEAD`):
   
   If you are using python package, please provide
   
   Python version and distribution:
   
   If you are using R package, please provide
   
   R `sessionInfo()`:
   
   ## Error Message:
   Please paste the full error message, including stack trace.
   
   ## Minimum reproducible example
   if you are using your own code, please provide a short script that 
reproduces the error.
   
   ## Steps to reproduce
   or if you are running standard examples, please provide the commands you 
have run that lead to the error.
   
   1.
   2.
   3.
   
   ## What have you tried to solve it?
   
   1.
   2.
   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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pdmengmeng opened a new issue #7408: How to do a sobel operation in symbol layer

2017-08-09 Thread git
pdmengmeng opened a new issue #7408: How to do a sobel operation in symbol layer
URL: https://github.com/apache/incubator-mxnet/issues/7408
 
 
there is a symbol layer , its size is ( 1 ,1 ,300 ,300 ) .How to use it to 
do a sobel operation.
   I kown that  we need to use symbol.broadcast_add/broadcast_sub..
   But how to select the specif area, Symbol can be used as numpy ?  
   
   Symbol[ : ,: , 1:W, 1: H] - Symbol [:,:,0:W-1,  0: H-1]  this is right?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] jeremiedb commented on issue #7349: time series delay output mxnet

2017-08-09 Thread git
jeremiedb commented on issue #7349: time series delay output mxnet
URL: 
https://github.com/apache/incubator-mxnet/issues/7349#issuecomment-321432460
 
 
   symbol.RNN performs the unrolling. 
   Taking a minimal example: 
   
   ```
   data <- mx.symbol.Variable("data")
   rnn.weight <- mx.symbol.Variable("rnn.weight")
   rnn <- mx.symbol.RNN(data = data, num.layers=1, state.size=10)
   regression <- mx.symbol.LinearRegressionOutput(data=rnn, name="final 
regression")
   ```
   Here a sequence of length 51 with batch of 64 and 20 features and sent into 
a RNN which outputs 1 output for each of the 51 elements of fed into the model.
   
   
![graph0](https://user-images.githubusercontent.com/18605903/29151649-bc5f7260-7d50-11e7-8e55-441c416aaf4f.png)
   
   If taking the last element of the sequence, you then feed only the latest 
(51th element) into the regression output. 
   
   
![graph1](https://user-images.githubusercontent.com/18605903/29151650-bf8b7506-7d50-11e7-8a19-71e5c933b704.png)
   
   You might need to hack a little the FeedForward function to account for 
extra parameters required by the RNN cell. The [symbol 
documentation](http://mxnet.io/api/python/symbol.html) should provide the 
required tool to adapt the network according to your needs. 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] idealboy commented on issue #6975: a problem in distribute training

2017-08-09 Thread git
idealboy commented on issue #6975: a problem in distribute training
URL: 
https://github.com/apache/incubator-mxnet/issues/6975#issuecomment-321432338
 
 
   sir, will you instruct me for distribute training on two machines, thank you 
very much. I dit it according the official document, but it did not work on two 
machines
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] EsraaRagaa commented on issue #4989: How to use mxnet?

2017-08-09 Thread git
EsraaRagaa commented on issue #4989: How to use mxnet?
URL: 
https://github.com/apache/incubator-mxnet/issues/4989#issuecomment-321430517
 
 
   The tutorials are unclear, I guess after preparing the iterator their should 
be an example of how to pass this iterator to mxnet as training and testing 
with lables
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] EsraaRagaa commented on a change in pull request #6221: Update IO Tutorial

2017-08-09 Thread git
EsraaRagaa commented on a change in pull request #6221: Update IO Tutorial
URL: https://github.com/apache/incubator-mxnet/pull/6221#discussion_r132348701
 
 

 ##
 File path: docs/tutorials/basic/data.md
 ##
 @@ -125,37 +49,41 @@ for batch in data_iter:
 print([batch.data, batch.label, batch.pad])
 ```
 
-## Read CSV
-
-There is an iterator called `CSVIter` to read data batches from CSV files. We
-first dump `data` into a csv file, and then load the data.
+## Reading data from CSV files
+MXNet provides [`CSVIter`](http://mxnet.io/api/python/io.html#mxnet.io.CSVIter)
+to read from CSV files and can be used as below:
 
 ```python
+#lets save `data` into a csv file first and try reading it back
 np.savetxt('data.csv', data, delimiter=',')
 data_iter = mx.io.CSVIter(data_csv='data.csv', data_shape=(3,), batch_size=30)
 for batch in data_iter:
 print([batch.data, batch.pad])
 ```
 
 
 Review comment:
   I am having a dataset and I want to pass it to mxnet, I tried to put it in a 
csv formate(considered the flattening issue) and call it by CSViter, but I 
should pass the csv label too, and when I do that the kernel(at anaconda) crash 
always!
   What should I do!
   
   can you add the next step after creating the csv iterator, which is passing 
that iterator to mxnet as the training or testing set, please? Thanks
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7352: add Sequential compatibility to rnn layers

2017-08-09 Thread git
szha commented on issue #7352: add Sequential compatibility to rnn layers
URL: https://github.com/apache/incubator-mxnet/pull/7352#issuecomment-321428024
 
 
   The scala unit test error doesn't seem related to this PR.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on a change in pull request #7352: add Sequential compatibility to rnn layers

2017-08-09 Thread git
szha commented on a change in pull request #7352: add Sequential compatibility 
to rnn layers
URL: https://github.com/apache/incubator-mxnet/pull/7352#discussion_r132342977
 
 

 ##
 File path: python/mxnet/gluon/rnn/rnn_layer.py
 ##
 @@ -487,6 +502,7 @@ class GRU(_RNNLayer):
 >>> input = mx.nd.random_uniform(shape=(5, 3, 10))
 >>> h0 = mx.nd.random_uniform(shape=(3, 3, 100))
 >>> output, hn = layer(input, h0)
+>>> output = layer(input) # zeros are used as begin state
 
 Review comment:
   Updated.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing closed issue #6629: Not enough information to get shape

2017-08-09 Thread git
thirdwing closed issue #6629: Not enough information to get shape
URL: https://github.com/apache/incubator-mxnet/issues/6629
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhreshold opened a new pull request #7404: Hotfix mx.image documents

2017-08-09 Thread git
zhreshold opened a new pull request #7404: Hotfix mx.image documents
URL: https://github.com/apache/incubator-mxnet/pull/7404
 
 
   Fix wrong doc descriptions in image package
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong opened a new pull request #7403: Add autograd function

2017-08-09 Thread git
piiswrong opened a new pull request #7403: Add autograd function
URL: https://github.com/apache/incubator-mxnet/pull/7403
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet] branch master updated: remove dmlc/mxnet logo from readme (#7256)

2017-08-09 Thread muli
This is an automated email from the ASF dual-hosted git repository.

muli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new 85ad649  remove dmlc/mxnet logo from readme (#7256)
85ad649 is described below

commit 85ad64921f1b89dd6130087612e102b7728f459d
Author: Dom Divakaruni 
AuthorDate: Wed Aug 9 17:16:23 2017 -0700

remove dmlc/mxnet logo from readme (#7256)

remove dmlc/mxnet logo from readme
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 6b62986..5027f6d 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-https://raw.githubusercontent.com/dmlc/dmlc.github.io/master/img/logo-m/mxnet2.png
 width=135/> *for Deep Learning*
+Apache MXNet (incubating) for Deep Learning
 =
 
 [![Build 
Status](https://travis-ci.org/dmlc/mxnet.svg?branch=master)](https://travis-ci.org/dmlc/mxnet)
@@ -7,7 +7,7 @@
 
 
![banner](https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/banner.png)
 
-MXNet is a deep learning framework designed for both *efficiency* and 
*flexibility*.
+Apache MXNet (incubating) is a deep learning framework designed for both 
*efficiency* and *flexibility*.
 It allows you to ***mix*** [symbolic and imperative 
programming](http://mxnet.io/architecture/index.html#deep-learning-system-design-concepts)
 to ***maximize*** efficiency and productivity.
 At its core, MXNet contains a dynamic dependency scheduler that automatically 
parallelizes both symbolic and imperative operations on the fly.

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" '].


[GitHub] mli closed pull request #7256: remove dmlc/mxnet logo from readme

2017-08-09 Thread git
mli closed pull request #7256: remove dmlc/mxnet logo from readme
URL: https://github.com/apache/incubator-mxnet/pull/7256
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong closed pull request #7347: Tensorcore conv deconv support

2017-08-09 Thread git
piiswrong closed pull request #7347: Tensorcore conv deconv support
URL: https://github.com/apache/incubator-mxnet/pull/7347
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet-site] branch asf-site updated (ea49a54 -> 2956248)

2017-08-09 Thread lxn2
This is an automated email from the ASF dual-hosted git repository.

lxn2 pushed a change to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-site.git.


from ea49a54  Merge pull request #3 from kevinthesun/AddDisclaimerto0.10
 add 28d1b0a  Fix
 new 2956248  Merge pull request #4 from kevinthesun/AddDisclaimerto0.10

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" '].


[incubator-mxnet-site] 01/01: Merge pull request #4 from kevinthesun/AddDisclaimerto0.10

2017-08-09 Thread lxn2
This is an automated email from the ASF dual-hosted git repository.

lxn2 pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-site.git

commit 295624861196b4aa6da4f2e1ce6f149e277eb9c8
Merge: ea49a54 28d1b0a
Author: lxn2 
AuthorDate: Wed Aug 9 16:32:01 2017 -0700

Merge pull request #4 from kevinthesun/AddDisclaimerto0.10

Add disclaimer

 index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
"comm...@mxnet.apache.org" .


[GitHub] lxn2 closed pull request #4: Add disclaimer

2017-08-09 Thread git
lxn2 closed pull request #4: Add disclaimer
URL: https://github.com/apache/incubator-mxnet-site/pull/4
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] lxn2 commented on issue #7402: Add disclaimer and download link

2017-08-09 Thread git
lxn2 commented on issue #7402: Add disclaimer and download link
URL: https://github.com/apache/incubator-mxnet/pull/7402#issuecomment-321407194
 
 
   Please include this full disclaimer: 
http://incubator.apache.org/guides/branding.html#disclaimers
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing commented on issue #6132: building R mxnet from source, R session get blocked after run 'make rpkg'

2017-08-09 Thread git
thirdwing commented on issue #6132: building R mxnet from source, R session get 
blocked after run 'make rpkg'
URL: 
https://github.com/apache/incubator-mxnet/issues/6132#issuecomment-321407104
 
 
   I am closing this since it has been inactive for a while. Feel free to 
reopen if necessary.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing commented on issue #5755: R version CUDA failure on Amazon ec2 (ubuntu14.04)

2017-08-09 Thread git
thirdwing commented on issue #5755: R version CUDA failure on Amazon ec2 
(ubuntu14.04)
URL: 
https://github.com/apache/incubator-mxnet/issues/5755#issuecomment-321401667
 
 
   I am closing this since it has been inactive for quite a while. Feel free to 
reopen if necessary.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing commented on issue #3549: ubuntu mxnet install issue

2017-08-09 Thread git
thirdwing commented on issue #3549: ubuntu mxnet install issue
URL: 
https://github.com/apache/incubator-mxnet/issues/3549#issuecomment-321401431
 
 
   I am closing this since it has been inactive. Feel free to reopen if 
necessary.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing closed issue #3549: ubuntu mxnet install issue

2017-08-09 Thread git
thirdwing closed issue #3549: ubuntu mxnet install issue
URL: https://github.com/apache/incubator-mxnet/issues/3549
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing commented on issue #6629: Not enough information to get shape

2017-08-09 Thread git
thirdwing commented on issue #6629: Not enough information to get shape
URL: 
https://github.com/apache/incubator-mxnet/issues/6629#issuecomment-321399282
 
 
   With the latest version of mxnet from github, the code works well:
   
   ```r
   library(mxnet)
   
   train.x = matrix(data = rexp(200, rate = 10), nrow = 120, ncol = 6380)
   train.y = matrix(data = rexp(6380, rate = 10), nrow = 120, ncol = 319)
   
   # Reshape testing data
   train.array <- train.x
   dim(train.array) <- c(319, 20, 120)
   dim(train.y) <- c(319, 120)
   
   data <- mx.symbol.Variable("data")
   
   # Define the first fully connected layer
   fc1 <- mx.symbol.FullyConnected(data, num_hidden = 100)
   act.fun <- mx.symbol.Activation(fc1, act_type = "relu") # create a hidden 
layer with Rectified Linear Unit as its activation function.
   output <- mx.symbol.FullyConnected(act.fun, num_hidden = 319)
   
   # Customize loss function
   label <- mx.symbol.Variable("label")
   
   output_mean <- mx.symbol.mean(output)
   label_mean <- mx.symbol.mean(label)
   
   output_delta <- mx.symbol.broadcast_sub(output, output_mean)
   label_delta <- mx.symbol.broadcast_sub(label, label_mean)
   
   output_sqr <- mx.symbol.square(output_delta)
   label_sqr <- mx.symbol.square(label_delta)
   
   output_sd <- mx.symbol.sqrt(mx.symbol.sum(output_delta))
   label_sd <- mx.symbol.sqrt(mx.symbol.sum(label_delta))
   
   numerator <- mx.symbol.sum(output_delta * label_delta)
   denominator <- output_sd * label_sd
   
   lro <- mx.symbol.MakeLoss(numerator / denominator)
   
   # Generate a new model
   model <- mx.model.FeedForward.create(symbol = lro,
X = train.array,
y = train.y,
num.round = 5000,
array.batch.size = 1,
optimizer = "adam",
learning.rate = 0.0003,
eval.metric = mx.metric.rmse,
epoch.end.callback = 
mx.callback.log.train.metric(20))
   ```
   ```
   Start training with 1 devices
   [1] Train-rmse=NaN
   ...
   ```
   
   The output of `Makeloss` is the gradient, so the `mx.metric.rmse` produced 
NaN.
   
   If you are using the prebuilt pkg, please wait for the update. I will update 
it soon.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7304: [WIP] gluon bce & ctc losses

2017-08-09 Thread git
piiswrong commented on a change in pull request #7304: [WIP] gluon bce & ctc 
losses
URL: https://github.com/apache/incubator-mxnet/pull/7304#discussion_r132318239
 
 

 ##
 File path: python/mxnet/gluon/loss.py
 ##
 @@ -148,13 +150,48 @@ def __init__(self, weight=None, batch_axis=0, **kwargs):
 super(L1Loss, self).__init__(weight, batch_axis, **kwargs)
 
 def hybrid_forward(self, F, output, label, sample_weight=None):
-if F is ndarray:
-loss = ndarray.abs(output - label.reshape(output.shape))
+label = _reshape_label_as_output(F, output, label)
+loss = F.abs(output - label)
+loss = _apply_weighting(F, loss, self._weight, sample_weight)
+return F.mean(loss, axis=self._batch_axis, exclude=True)
+
+
+class BinaryCrossEntropyLoss(Loss):
+r"""The cross-entropy loss for binary classification.
+
+BCE loss is useful when training logistic regression.
+
+.. math::
+loss(o, t) = - 1/n \sum_i (t[i] * log(o[i]) + (1 - t[i]) * log(1 - 
o[i]))
+
+
+Parameters
+--
+from_sigmoid : bool, default is `False`
+Whether the input is from the output of sigmoid. Set this to false 
will make
+the loss calculate sigmoid and then BCE, which is more numerically 
stable through
+log-sum-exp trick.
+weight : float or None
+Global scalar weight for loss.
+sample_weight : Symbol or None
+Per sample weighting. Must be broadcastable to
+the same shape as loss. For example, if loss has
+shape (64, 10) and you want to weight each sample
+in the batch, `sample_weight` should have shape (64, 1).
+batch_axis : int, default 0
+The axis that represents mini-batch.
+"""
+def __init__(self, from_sigmoid=False, weight=None, batch_axis=0, 
**kwargs):
+super(BinaryCrossEntropyLoss, self).__init__(weight, batch_axis, 
**kwargs)
+self._from_sigmoid = from_sigmoid
+
+def hybrid_forward(self, F, output, label, sample_weight=None):
+label = _reshape_label_as_output(F, output, label)
+if not self._from_sigmoid:
+max_val = F.maximum(-output, 0)
+loss = output - output*label + max_val + 
F.log(F.exp(-max_val)+F.exp(-output-max_val))
 
 Review comment:
   add test to compare against softmaxcrossentropy with 2 classes
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7352: add Sequential compatibility to rnn layers

2017-08-09 Thread git
piiswrong commented on a change in pull request #7352: add Sequential 
compatibility to rnn layers
URL: https://github.com/apache/incubator-mxnet/pull/7352#discussion_r132317845
 
 

 ##
 File path: python/mxnet/gluon/rnn/rnn_layer.py
 ##
 @@ -286,6 +293,8 @@ class RNN(_RNNLayer):
 The recurrent state's shape is `(num_layers, batch_size, num_hidden)`.
 If `bidirectional` is True, state shape will instead be
 `(2*num_layers, batch_size, num_hidden)`
+If input recurrent state is None, zeros are used as default begin 
states,
 
 Review comment:
   Recurrent state shape -> Recurrent state.
   
   and change the beginning sentence to The recurrent states is an NDArray with 
shape xxx.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7352: add Sequential compatibility to rnn layers

2017-08-09 Thread git
piiswrong commented on a change in pull request #7352: add Sequential 
compatibility to rnn layers
URL: https://github.com/apache/incubator-mxnet/pull/7352#discussion_r132316721
 
 

 ##
 File path: python/mxnet/gluon/rnn/rnn_layer.py
 ##
 @@ -487,6 +502,7 @@ class GRU(_RNNLayer):
 >>> input = mx.nd.random_uniform(shape=(5, 3, 10))
 >>> h0 = mx.nd.random_uniform(shape=(3, 3, 100))
 >>> output, hn = layer(input, h0)
+>>> output = layer(input) # zeros are used as begin state
 
 Review comment:
   ```
>>> input = mx.nd.random_uniform(shape=(5, 3, 10))
>>> # by default zeros are used as begin state
>>> output = layer(input)
>>> # manually specify begin state.
 >>> h0 = mx.nd.random_uniform(shape=(3, 3, 100))
 >>> output, hn = layer(input, h0)
   ```
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7352: add Sequential compatibility to rnn layers

2017-08-09 Thread git
piiswrong commented on a change in pull request #7352: add Sequential 
compatibility to rnn layers
URL: https://github.com/apache/incubator-mxnet/pull/7352#discussion_r132316721
 
 

 ##
 File path: python/mxnet/gluon/rnn/rnn_layer.py
 ##
 @@ -487,6 +502,7 @@ class GRU(_RNNLayer):
 >>> input = mx.nd.random_uniform(shape=(5, 3, 10))
 >>> h0 = mx.nd.random_uniform(shape=(3, 3, 100))
 >>> output, hn = layer(input, h0)
+>>> output = layer(input) # zeros are used as begin state
 
 Review comment:
   ???
>>> input = mx.nd.random_uniform(shape=(5, 3, 10))
>>> # by default zeros are used as begin state
>>> output = layer(input)
>>> # manually specify begin state.
 >>> h0 = mx.nd.random_uniform(shape=(3, 3, 100))
 >>> output, hn = layer(input, h0)
   ???
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] LakeCarrot commented on issue #5285: train_cifar10.py not running

2017-08-09 Thread git
LakeCarrot commented on issue #5285: train_cifar10.py not running
URL: 
https://github.com/apache/incubator-mxnet/issues/5285#issuecomment-321380917
 
 
   @sampathchanda @chuckbasstan123 
   I believe it is because the batch size is too large and out of memory. Try 
to set the batch size to one at first, and see whether it can work or not.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] LakeCarrot commented on issue #5285: train_cifar10.py not running

2017-08-09 Thread git
LakeCarrot commented on issue #5285: train_cifar10.py not running
URL: 
https://github.com/apache/incubator-mxnet/issues/5285#issuecomment-321380917
 
 
   @sampathchanda @chuckbasstan123 
   I believe it is the batch size is too large and out of memory. Try to set 
the batch size to one at first, and see whether it can work or not.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing opened a new pull request #7401: [R][MISC] update Makefile/Jenkinsfile; use mx.ctx.default() in R test

2017-08-09 Thread git
thirdwing opened a new pull request #7401: [R][MISC] update 
Makefile/Jenkinsfile; use mx.ctx.default() in R test
URL: https://github.com/apache/incubator-mxnet/pull/7401
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong closed pull request #7357: [Perl] Bugfixes and sync with python symbolic code

2017-08-09 Thread git
piiswrong closed pull request #7357: [Perl] Bugfixes and sync with python 
symbolic code
URL: https://github.com/apache/incubator-mxnet/pull/7357
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet] branch master updated: fix [#7368] Caffe converter test fails, causing CI to halt for all PRs (#7381)

2017-08-09 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new a33ded7  fix [#7368] Caffe converter test fails, causing CI to halt 
for all PRs  (#7381)
a33ded7 is described below

commit a33ded796325c8da4eebab07a18ddc616ad28098
Author: joey2014 
AuthorDate: Wed Aug 9 15:19:21 2017 -0500

fix [#7368] Caffe converter test fails, causing CI to halt for all PRs  
(#7381)

* support convert mtcnn and MobileNet model

* pass python lint

* put "import re" before "import caffe_parser" as lint required

* correct missed checkin  and pass pylint

* When converting vgg16 model, the layer fc6 input name pool5 is changed to 
flatten_0 by _parse_proto(). It misleads adding the layer to group.

* revert disable vgg-16 resnet converter check (#7369)
---
 tools/caffe_converter/convert_model.py  | 13 -
 tools/caffe_converter/convert_symbol.py | 21 ++---
 tools/caffe_converter/test_converter.py |  2 +-
 3 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/tools/caffe_converter/convert_model.py 
b/tools/caffe_converter/convert_model.py
index c04a2aa..1624a01 100644
--- a/tools/caffe_converter/convert_model.py
+++ b/tools/caffe_converter/convert_model.py
@@ -26,6 +26,17 @@ import mxnet as mx
 import numpy as np
 from convert_symbol import convert_symbol
 
+def prob_label(arg_names):
+candidates = [arg for arg in arg_names if
+  not arg.endswith('data') and
+  not arg.endswith('_weight') and
+  not arg.endswith('_bias') and
+  not arg.endswith('_gamma') and
+  not arg.endswith('_beta')]
+if len(candidates) == 0:
+return 'prob_label'
+return candidates[-1]
+
 def convert_model(prototxt_fname, caffemodel_fname, output_prefix=None):
 """Convert caffe model
 
@@ -198,7 +209,7 @@ def convert_model(prototxt_fname, caffemodel_fname, 
output_prefix=None):
 assert len(layer_blobs) == 0
 
 if output_prefix is not None:
-model = mx.mod.Module(symbol=sym, label_names=[arg_names[-1], ])
+model = mx.mod.Module(symbol=sym, label_names=[prob_label(arg_names), 
])
 model.bind(data_shapes=[('data', tuple(input_dim))])
 model.init_params(arg_params=arg_params, aux_params=aux_params)
 model.save_checkpoint(output_prefix, 0)
diff --git a/tools/caffe_converter/convert_symbol.py 
b/tools/caffe_converter/convert_symbol.py
index dde3c26..13b55fe 100644
--- a/tools/caffe_converter/convert_symbol.py
+++ b/tools/caffe_converter/convert_symbol.py
@@ -145,6 +145,16 @@ def _parse_proto(prototxt_fname):
 param_string = ''
 skip_layer = False
 name = re.sub('[-/]', '_', layer.name)
+for k in range(len(layer.bottom)):
+if layer.bottom[k] in _output_name:
+_output_name[layer.bottom[k]]['count'] = 
_output_name[layer.bottom[k]]['count']+1
+else:
+_output_name[layer.bottom[k]] = {'count':0}
+for k in range(len(layer.top)):
+if layer.top[k] in _output_name:
+_output_name[layer.top[k]]['count'] = 
_output_name[layer.top[k]]['count']+1
+else:
+_output_name[layer.top[k]] = {'count':0, 'name':name}
 if layer.type == 'Convolution' or layer.type == 4:
 type_string = 'mx.symbol.Convolution'
 param_string = _convert_conv_param(layer.convolution_param)
@@ -270,17 +280,6 @@ def _parse_proto(prototxt_fname):
 for j in range(len(layer.top)):
 mapping[layer.top[j]] = name
 output_name = name
-for k in range(len(layer.bottom)):
-if layer.bottom[k] in _output_name:
-_output_name[layer.bottom[k]]['count'] = 
_output_name[layer.bottom[k]]['count']+1
-else:
-_output_name[layer.bottom[k]] = {'count':0}
-for k in range(len(layer.top)):
-if layer.top[k] in _output_name:
-_output_name[layer.top[k]]['count'] = 
_output_name[layer.top[k]]['count']+1
-else:
-_output_name[layer.top[k]] = {'count':0, 'name':name}
-
 output_name = []
 for i in _output_name:
 if 'name' in _output_name[i] and _output_name[i]['count'] == 0:
diff --git a/tools/caffe_converter/test_converter.py 
b/tools/caffe_converter/test_converter.py
index db17c64..cdf8331 100644
--- a/tools/caffe_converter/test_converter.py
+++ b/tools/caffe_converter/test_converter.py
@@ -95,7 +95,7 @@ def main():
 assert gpus, 'At least one GPU is needed to run test_converter in GPU 
mode'
 batch_size = 32 * len(gpus)
 
-models = ['bvlc_googlenet']
+models = ['bvlc_googlenet', 'vgg-16', 'resnet-50']
 
 

[GitHub] piiswrong closed pull request #7381: fix [#7368] Caffe converter test fails, causing CI to halt for all PRs

2017-08-09 Thread git
piiswrong closed pull request #7381: fix [#7368] Caffe converter test fails, 
causing CI to halt for all PRs 
URL: https://github.com/apache/incubator-mxnet/pull/7381
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet] branch master updated: Drafted documentation for autograd. (#7395)

2017-08-09 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new bd845aa  Drafted documentation for autograd.  (#7395)
bd845aa is described below

commit bd845aa58c08329192fc142f598d045275f43342
Author: Zack Chase Lipton 
AuthorDate: Wed Aug 9 13:07:57 2017 -0700

Drafted documentation for autograd.  (#7395)

* added autograd documentation

* adding output for snippet

* adding output for snippet

* typo fix

* typo fix

* revised the autograd doc

* typo

* added sentence about autograd.pause():

* typo

* further deflation

* Update autograd.md
---
 docs/api/python/autograd.md | 58 +
 1 file changed, 58 insertions(+)

diff --git a/docs/api/python/autograd.md b/docs/api/python/autograd.md
index d204a2c..5c84964 100644
--- a/docs/api/python/autograd.md
+++ b/docs/api/python/autograd.md
@@ -9,6 +9,64 @@
 .. warning:: This package is currently experimental and may change in the near 
future.
 ```
 
+## Overview
+
+The `autograd` package enables automatic
+differentiation of NDArray operations.
+In machine learning applications,
+`autograd` is often used to calculate the gradients
+of loss functions with respect to parameters.
+
+
+### Record vs Pause
+
+`autograd` records computation history on the fly to calculate gradients later.
+This is only enabled inside a `with autograd.record():` block.
+A `with auto_grad.pause()` block can be used inside a `record()` block
+to temporarily disable recording.
+
+To compute gradient with respect to an `NDArray` `x`, first call 
`x.attach_grad()`
+to allocate space for the gradient. Then, start a `with autograd.record()` 
block,
+and do some computation. Finally, call `backward()` on the result:
+
+```python
+>>> x = mx.nd.array([1,2,3,4])
+>>> x.attach_grad()
+>>> with mx.autograd.record():
+... y = x * x + 1
+>>> print(x.grad)
+[ 2.  4.  6.  8.]
+
+```
+
+
+## Train mode and Predict Mode
+
+Some operators (Dropout, BatchNorm, etc) behave differently in
+when training and when making predictions.
+This can be controled with `train_mode` and `predict_mode` scope.
+
+By default, MXNet is in `predict_mode`.
+A `with autograd.record()` block by default turns on `train_mode`
+(equivalent to ``with autograd.record(train_mode=True)``).
+To compute a gradient in prediction mode (as when generating adversarial 
examples),
+call record with `train_mode=False` and then call `backward(train_mode=False)`
+
+Although training usually coincides with recording,
+this isn't always the case.
+To control *training* vs *predict_mode* without changing
+*recording* vs *not recording*,
+Use a `with autograd.train_mode():`
+or `with autograd.predict_mode():` block.
+
+Detailed tutorials are available in Part 1 of
+[the MXNet gluon book](http://gluon.mxnet.io/).
+
+
+
+
+
+
 
 
 ## Autograd

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" '].


[GitHub] piiswrong closed pull request #7395: Drafted documentation for autograd.

2017-08-09 Thread git
piiswrong closed pull request #7395: Drafted documentation for autograd. 
URL: https://github.com/apache/incubator-mxnet/pull/7395
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet-site] 01/01: Merge pull request #2 from kevinthesun/asf-site

2017-08-09 Thread lxn2
This is an automated email from the ASF dual-hosted git repository.

lxn2 pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-site.git

commit 7e4d77679f438fb94716159e7ae52fadf5cc9a81
Merge: 727638a a7cb5f1
Author: lxn2 
AuthorDate: Wed Aug 9 12:52:35 2017 -0700

Merge pull request #2 from kevinthesun/asf-site

Fix localhost

 README.html|  4 ++--
 _static/mxnet-theme/index.html | 12 ++--
 _static/mxnet-theme/navbar.html|  4 ++--
 api/c++/index.html |  4 ++--
 api/julia/index.html   |  4 ++--
 api/perl/index.html|  4 ++--
 api/perl/io.html   |  4 ++--
 api/perl/kvstore.html  |  4 ++--
 api/perl/module.html   |  4 ++--
 api/perl/ndarray.html  |  4 ++--
 api/perl/symbol.html   |  4 ++--
 api/python/callback.html   |  4 ++--
 api/python/index.html  |  4 ++--
 api/python/io.html |  4 ++--
 api/python/kvstore.html|  4 ++--
 api/python/metric.html |  4 ++--
 api/python/model.html  |  4 ++--
 api/python/module.html |  4 ++--
 api/python/ndarray.html| 14 +++---
 api/python/optimization.html   |  4 ++--
 api/python/rnn.html|  4 ++--
 api/python/symbol.html |  4 ++--
 api/python/symbol_in_pictures.html |  4 ++--
 api/r/index.html   |  4 ++--
 api/scala/index.html   |  4 ++--
 api/scala/io.html  |  4 ++--
 api/scala/kvstore.html |  4 ++--
 api/scala/model.html   |  4 ++--
 api/scala/module.html  |  4 ++--
 api/scala/ndarray.html |  4 ++--
 api/scala/symbol.html  |  4 ++--
 api/scala/symbol_in_pictures.html  |  4 ++--
 architecture/index.html|  4 ++--
 architecture/note_data_loading.html|  4 ++--
 architecture/note_engine.html  |  4 ++--
 architecture/note_memory.html  |  4 ++--
 architecture/overview.html |  4 ++--
 architecture/program_model.html|  4 ++--
 architecture/release_note_0_9.html |  4 ++--
 architecture/rnn_interface.html|  4 ++--
 community/contribute.html  |  4 ++--
 community/index.html   |  4 ++--
 community/mxnet_channels.html  |  4 ++--
 doxygen/annotated.html |  2 +-
 doxygen/base_8h.html   |  4 +---
 doxygen/base_8h_source.html|  2 +-
 doxygen/c__api_8h.html |  4 +---
 doxygen/c__api_8h_source.html  |  2 +-
 doxygen/c__lapack__api_8h.html |  4 +---
 doxygen/c__lapack__api_8h_source.html  |  2 +-
 doxygen/c__predict__api_8h.html|  2 +-
 doxygen/c__predict__api_8h_source.html |  2 +-
 ...ter_1_1FieldEntry_3_01mxnet_1_1TShape_01_4-members.html |  2 +-
 ..._1parameter_1_1FieldEntry_3_01mxnet_1_1TShape_01_4.html |  6 +-
 doxygen/classes.html   |  2 +-
 doxygen/classmxnet_1_1Engine-members.html  |  2 +-
 doxygen/classmxnet_1_1Engine.html  |  4 +---
 doxygen/classmxnet_1_1Executor-members.html|  2 +-
 doxygen/classmxnet_1_1Executor.html|  4 +---
 doxygen/classmxnet_1_1IIterator-members.html   |  2 +-
 doxygen/classmxnet_1_1IIterator.html   |  6 +-
 doxygen/classmxnet_1_1KVStore-members.html |  2 +-
 doxygen/classmxnet_1_1KVStore.html |  4 +---
 doxygen/classmxnet_1_1NDArray-members.html |  2 +-
 doxygen/classmxnet_1_1NDArray.html |  4 +---
 

[GitHub] fhieber commented on a change in pull request #7395: Drafted documentation for autograd.

2017-08-09 Thread git
fhieber commented on a change in pull request #7395: Drafted documentation for 
autograd. 
URL: https://github.com/apache/incubator-mxnet/pull/7395#discussion_r132286027
 
 

 ##
 File path: docs/api/python/autograd.md
 ##
 @@ -9,6 +9,64 @@
 .. warning:: This package is currently experimental and may change in the near 
future.
 ```
 
+## Overview
+
+The `autograd` package enables automatic
+differentiation of NDArray operations.
+In machine learning applications,
+`autograd` is often used to calculate the gradients
+of loss functions with respect to parameters.
+
+
+### Record vs Pause
+
+`autograd` records computation history on the fly to calculate gradients later.
+This is only enabled inside a `with autograd.record():` block.
+A `with auto_grad.pause()` block can be used inside a `record()` block
+to temporarily disable recording.
+
+To compute gradient with respect to an `NDArray` `x`, first call 
`x.attach_grad()`
+to allocate space for the gradient. Then, start a `with autograd.record()` 
block,
+and do some computation. Finally, call `backward()` on the result:
+
+```python
+>>> x = mx.nd.array([1,2,3,4])
+>>> x.attach_grad()
+>>> with mx.autograd.record():
+... y = x * x + 1
+>>> print(x.grad)
+[ 2.  4.  6.  8.]
+
+```
+
+
+## Train mode and Predict Mode
+
+Some operators (Dropout, BatchNorm, etc) behave differently in
 
 Review comment:
   -in 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] fhieber commented on a change in pull request #7395: Drafted documentation for autograd.

2017-08-09 Thread git
fhieber commented on a change in pull request #7395: Drafted documentation for 
autograd. 
URL: https://github.com/apache/incubator-mxnet/pull/7395#discussion_r132285955
 
 

 ##
 File path: docs/api/python/autograd.md
 ##
 @@ -9,6 +9,64 @@
 .. warning:: This package is currently experimental and may change in the near 
future.
 ```
 
+## Overview
+
+The `autograd` package enables automatic
+differentiation of NDArray operations.
+In machine learning applications,
+`autograd` is often used to calculate the gradients
+of loss functions with respect to parameters.
+
+
+### Record vs Pause
+
+`autograd` records computation history on the fly to calculate gradients later.
+This is only enabled inside a `with autograd.record():` block.
+A `with auto_grad.pause()` block can be used inside a `record()` block
+to temporarily disable recording.
+
+To compute gradient with respect to an `NDArray` `x`, first call 
`x.attach_grad()`
+to allocate space for the gradient. Then, start a `with autograd.record()` 
block,
+and do some computation. Finally, call `backward()` on the result:
+
+```python
+>>> x = mx.nd.array([1,2,3,4])
+>>> x.attach_grad()
+>>> with mx.autograd.record():
+... y = x * x + 1
+>>> print(x.grad)
+[ 2.  4.  6.  8.]
+
+```
+
+
+## Train mode and Predict Mode
+
+Some operators (Dropout, BatchNorm, etc) behave differently in
+when training and when making predictions.
+This can be controled with `train_mode` and `predict_mode` scope.
 
 Review comment:
   typo: controled -> controlled
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] fhieber commented on a change in pull request #7395: Drafted documentation for autograd.

2017-08-09 Thread git
fhieber commented on a change in pull request #7395: Drafted documentation for 
autograd. 
URL: https://github.com/apache/incubator-mxnet/pull/7395#discussion_r132285787
 
 

 ##
 File path: docs/api/python/autograd.md
 ##
 @@ -9,6 +9,64 @@
 .. warning:: This package is currently experimental and may change in the near 
future.
 ```
 
+## Overview
+
+The `autograd` package enables automatic
+differentiation of NDArray operations.
+In machine learning applications,
+`autograd` is often used to calculate the gradients
+of loss functions with respect to parameters.
+
+
+### Record vs Pause
+
+`autograd` records computation history on the fly to calculate gradients later.
+This is only enabled inside a `with autograd.record():` block.
+A `with auto_grad.pause()` block can be used inside a `record()` block
+to temporarily disable recording.
+
+To compute gradient with respect to an `NDArray` `x`, first call 
`x.attach_grad()`
+to allocate space for the gradient. Then, start a `with autograd.record()` 
block,
+and do some computation. Finally, call `backward()` on the result:
 
 Review comment:
   The following example does not seem to call a method called "backward()".
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] kurt-o-sys commented on issue #7349: time series delay output mxnet

2017-08-09 Thread git
kurt-o-sys commented on issue #7349: time series delay output mxnet
URL: 
https://github.com/apache/incubator-mxnet/issues/7349#issuecomment-321361000
 
 
   Oh yeah, this may be important: I'm defining the model separately from the 
training data:
   
   ```
   input <- mx.symbol.Variable("data")
   
   guess.add <- mx.symbol.slice(input, name=guesses added/removed",
begin=0, end=7)
   ...
   game.trend <- mx.symbol.RNN(..., name="game trend", 
   mode="gru", num.layers=1, state.size=1)
   regression <- mx.symbol.LinearRegressionOutput(lpeaks, name="final 
regression")
   ```
   
   I asked the question above before getting into the mxnet api itself. The 
question would be: do I need to unroll it first, so I can use 
mx.model.FeedForward.create to train it? Or is there a way to use the model as 
it is and feed it with a time-series dataset for training?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] haimeh commented on issue #6629: Not enough information to get shape

2017-08-09 Thread git
haimeh commented on issue #6629: Not enough information to get shape
URL: 
https://github.com/apache/incubator-mxnet/issues/6629#issuecomment-321357117
 
 
   @thirdwing @nnguyen24 

   If you replace the train.x and train.y array with:
   ```
   # Generate testing data
   train.x = matrix(data = rexp(200, rate = 10), nrow = 120, ncol = 6380)
   train.y = matrix(data = rexp(6380, rate = 10), nrow = 120, ncol = 319)
   
   # Reshape testing data
   train.array <- train.x
   dim(train.array) <- c(319,20,120)
   dim(train.y) <- c(319,120)
   
   ```
   You can trigger the error.
   The test set is not necessary to recreate the error.
   
   I experienced the same error with my own fancy loss function.
   I got around it, in the end, by implementing the loss inside a modified 
mx.model.train function (right before backward pass) replacing the symbols with 
mx.nd operations.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on issue #7395: Drafted documentation for autograd.

2017-08-09 Thread git
szha commented on issue #7395: Drafted documentation for autograd. 
URL: https://github.com/apache/incubator-mxnet/pull/7395#issuecomment-321351310
 
 
   Looks good to me. @piiswrong ?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet] branch sparse updated: Extending the GPU dot operator (#7226)

2017-08-09 Thread jxie
This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch sparse
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/sparse by this push:
 new 0c1e53e  Extending the GPU dot operator (#7226)
0c1e53e is described below

commit 0c1e53edcdae0fbb508feb232b3f1a0f1530c271
Author: Stefan Henneking 
AuthorDate: Wed Aug 9 11:34:39 2017 -0700

Extending the GPU dot operator (#7226)

* Added GPU DotCsrRspDnsImpl declaration and TODOs

* cleaning up function doc, variable types, and code-style

* minor bug fixes

* enable GPU dot(csr,rsp)=dns unit test

* extend sparse dot unit test

* adding GPU impl of DotCsrRspDns and its kernels

* add TODO

* changed variable types from index_t to dim_t

* fix function description

* added DotCsrRspRspImpl and its kernels (baseline, functionality)

* added DotCsrDnsRspImpl and its kernels (baseline, functionality); plus 
code documentation

* refactored dot benchmark

* optimized DotCsrTransDnsRsp GPU kernel

* change of dot impl interface to include OpContext, for temp storage

* removing __device__ flag from CPU kernels

* minor fixes and changing variable data types

* minor fixes based on code reviews
---
 benchmark/python/dot.py   | 263 
 benchmark/python/sparse_op.py | 228 ---
 src/operator/tensor/dot-inl.cuh   | 832 ++
 src/operator/tensor/dot-inl.h | 332 +-
 tests/python/gpu/test_operator_gpu.py |   2 +-
 tests/python/unittest/test_sparse_operator.py |  54 +-
 6 files changed, 1184 insertions(+), 527 deletions(-)

diff --git a/benchmark/python/dot.py b/benchmark/python/dot.py
new file mode 100644
index 000..2e5821a
--- /dev/null
+++ b/benchmark/python/dot.py
@@ -0,0 +1,263 @@
+import ctypes
+
+from mxnet.test_utils import *
+import scipy.sparse as sp
+import os
+import time
+import argparse
+
+from mxnet.base import check_call, _LIB
+from util import get_data, estimate_density
+
+parser = argparse.ArgumentParser(description="Benchmark sparse operators",
+ 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--num-omp-threads', type=int, default=1, help='number of 
omp threads to set in MXNet')
+args = parser.parse_args()
+
+# some data information
+kdda = {
+'data_mini': 'kdda.t.mini',
+'data_name': 'kdda.t',
+'data_origin_name': 'kdda.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/kdda.t.bz2;,
+'feature_dim': 20216830,
+'m': 200,
+'batch_size': [64]
+}
+
+avazu = {
+'data_mini': 'avazu-app.t.mini',
+'data_name': 'avazu-app.t',
+'data_origin_name': 'avazu-app.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/avazu-app.t.bz2;,
+'feature_dim': 100,
+'m': 500,
+'batch_size': [64, 128]
+}
+
+
+def measure_cost(repeat, f, *args, **kwargs):
+mx.nd.waitall()
+start = time.time()
+for i in range(repeat):
+f(*args, **kwargs)
+mx.nd.waitall()
+end = time.time()
+diff = end - start
+return diff / repeat
+
+
+def test_dot_real(data_dict):
+def get_iter(path, data_shape, batch_size):
+data_train = mx.io.LibSVMIter(data_libsvm=path,
+  data_shape=data_shape,
+  batch_size=batch_size)
+data_iter = iter(data_train)
+return data_iter
+
+data_dir = os.path.join(os.getcwd(), 'data')
+
+path = os.path.join(data_dir, data_dict['data_name'])
+if not os.path.exists(path):
+get_data(
+data_dir,
+data_dict['data_name'],
+data_dict['url'],
+data_dict['data_origin_name']
+)
+assert os.path.exists(path)
+
+k = data_dict['feature_dim']
+m = data_dict['m']
+density = estimate_density(path, data_dict['feature_dim'])
+
+mini_path = os.path.join(data_dir, data_dict['data_mini'])
+if not os.path.exists(mini_path):
+os.system("head -n 2000 %r > %r" % (path, mini_path))
+assert os.path.exists(mini_path)
+
+print "Running Benchmarking on %r data" % data_dict['data_mini']
+for batch_size in data_dict['batch_size']:  # iterator through different 
batch size of choice
+print "batch_size is %d" % batch_size
+# model
+data_shape = (k, )
+train_iter = get_iter(mini_path, data_shape, batch_size)
+weight = mx.nd.random_uniform(low=0, high=1, shape=(k, m))
+
+csr_data = []
+dns_data = []
+num_batch = 0
+for batch in train_iter:
+data = train_iter.getdata()
+csr_data.append(data)
+ 

[GitHub] piiswrong closed pull request #7226: Extending the GPU dot operator

2017-08-09 Thread git
piiswrong closed pull request #7226: Extending the GPU dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] kmichaelkills opened a new issue #7400: When does kWriteInplace happen?

2017-08-09 Thread git
kmichaelkills opened a new issue #7400: When does kWriteInplace happen?
URL: https://github.com/apache/incubator-mxnet/issues/7400
 
 
   I am trying to make an OP that do inplace in imperative mode. 
   
   For instance:
   
   ```python
   a = mx.nd.zeros([1])
   b = mx.nd.Add1(a)
   assert a.asnumpy()[0] == 1
   ```
   I've activated the ForwardInplace option in my operator, but the req type is 
still `kWrite`. When I do `mx.nd.Add1(a, out=a)`  it does inplace calculation, 
but the req type is still `kWrite` instead of `kWriteInplace`.

   Checking out the documentation, the explanation is missing:
   
   ```cpp
   // file /include/mxnet/op_attr_types.h
 /*!
  * \brief perform an inplace write,
  * Target shares memory with one of input arguments.
  * This option only happen when
  */
 kWriteInplace,
   ```
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] stefanhenneking commented on issue #7226: Extending the GPU dot operator

2017-08-09 Thread git
stefanhenneking commented on issue #7226: Extending the GPU dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#issuecomment-321337167
 
 
   thanks for reviewing, @reminisce, @eric-haibin-lin, @anirudh2290.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] stefanhenneking commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-09 Thread git
stefanhenneking commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132262452
 
 

 ##
 File path: src/operator/tensor/dot-inl.h
 ##
 @@ -187,8 +187,8 @@ inline bool DotForwardInferStorageType(const 
nnvm::NodeAttrs& attrs,
   CHECK_EQ(out_attrs->size(), 1U);
   const DotParam& param = nnvm::get(attrs.parsed);
   // csr has many zero columns, so the result of dot(csr.T, matrix) should be 
rsp
-  // dot(csr.T,dns)=rsp not yet implemented on gpu
-  if (param.transpose_a && kCSRStorage == (*in_attrs)[0] && ctx.dev_type != 
Context::kGPU) {
+  // TODO(stefan/haibin): don't enforce kRowSparseStorage if out_attrs has 
already been set
+  if (param.transpose_a && kCSRStorage == (*in_attrs)[0]) {
 STORAGE_TYPE_ASSIGN_CHECK(*out_attrs, 0, kRowSparseStorage);
 
 Review comment:
   let's get this one here merged since you need the operator asap, and I will 
make the `type_assign` changes in @eric-haibin-lin's fork.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] stefanhenneking commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-09 Thread git
stefanhenneking commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132260731
 
 

 ##
 File path: src/operator/tensor/dot-inl.h
 ##
 @@ -616,28 +677,27 @@ inline void DotCsrRspRspImpl(mshadow::Stream* s,
   MSHADOW_TYPE_SWITCH(data_l.type_flag_, DType, {  // data type
 MSHADOW_IDX_TYPE_SWITCH(indptr_l.type_flag_, IType, {  // indptr type
   MSHADOW_IDX_TYPE_SWITCH(col_idx_l.type_flag_, CType, {  // col idx type
-MSHADOW_IDX_TYPE_SWITCH(row_idx_r.type_flag_, RType, {  // col idx type
-  if (kWriteTo == req) {
-mxnet_op::Kernel::Launch(
-s, data_out.Size(), data_out.dptr());
-  }
-  int num_threads = mxnet_op::get_num_threads(data_out.shape_[0]);
-  size_t seg_len = (data_out.shape_[0] + num_threads - 1) / 
num_threads;
+MSHADOW_IDX_TYPE_SWITCH(row_idx_r.type_flag_, RType, {  // row idx type
+  dim_t num_threads, seg_len;
 
 Review comment:
   done.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] craftit closed pull request #7399: Remove inline keyword from methods we want to generate code for.

2017-08-09 Thread git
craftit closed pull request #7399: Remove inline keyword from methods we want 
to generate code for.
URL: https://github.com/apache/incubator-mxnet/pull/7399
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] stefanhenneking commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-09 Thread git
stefanhenneking commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132255546
 
 

 ##
 File path: benchmark/python/dot.py
 ##
 @@ -0,0 +1,265 @@
+import ctypes
+
+from mxnet.test_utils import *
+import scipy.sparse as sp
+import os
+import time
+import argparse
+
+from mxnet.base import check_call, _LIB
+from util import get_data, estimate_density
+
+parser = argparse.ArgumentParser(description="Benchmark sparse operators",
+ 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--num-omp-threads', type=int, default=1, help='number of 
omp threads to set in MXNet')
+args = parser.parse_args()
+
+# some data information
+kdda = {
+'data_mini': 'kdda.t.mini',
+'data_name': 'kdda.t',
+'data_origin_name': 'kdda.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/kdda.t.bz2;,
+'feature_dim': 20216830,
+'m': 200,
+'batch_size': [64]
+}
+
+avazu = {
+'data_mini': 'avazu-app.t.mini',
+'data_name': 'avazu-app.t',
+'data_origin_name': 'avazu-app.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/avazu-app.t.bz2;,
+'feature_dim': 100,
+'m': 500,
+'batch_size': [64, 128]
+}
+
+
+def measure_cost(wait, repeat, f, *args, **kwargs):
+start = time.time()
+if wait:
+for i in range(repeat):
+(f(*args, **kwargs)).wait_to_read()
+else:
+for i in range(repeat):
+f(*args, **kwargs)
+end = time.time()
+diff = end - start
+return diff / repeat
+
+
+def test_dot_real(data_dict):
+def get_iter(path, data_shape, batch_size):
+data_train = mx.io.LibSVMIter(data_libsvm=path,
+  data_shape=data_shape,
+  batch_size=batch_size)
+data_iter = iter(data_train)
+return data_iter
+
+data_dir = os.path.join(os.getcwd(), 'data')
+
+path = os.path.join(data_dir, data_dict['data_name'])
+if not os.path.exists(path):
+get_data(
+data_dir,
+data_dict['data_name'],
+data_dict['url'],
+data_dict['data_origin_name']
+)
+assert os.path.exists(path)
+
+k = data_dict['feature_dim']
+m = data_dict['m']
+density = estimate_density(path, data_dict['feature_dim'])
+
+mini_path = os.path.join(data_dir, data_dict['data_mini'])
+if not os.path.exists(mini_path):
+os.system("head -n 2000 %r > %r" % (path, mini_path))
+assert os.path.exists(mini_path)
+
+print "Running Benchmarking on %r data" % data_dict['data_mini']
+for batch_size in data_dict['batch_size']:  # iterator through different 
batch size of choice
+print "batch_size is %d" % batch_size
+# model
+data_shape = (k, )
+train_iter = get_iter(mini_path, data_shape, batch_size)
+weight = mx.nd.random_uniform(low=0, high=1, shape=(k, m))
+
+csr_data = []
+dns_data = []
+num_batch = 0
+for batch in train_iter:
+data = train_iter.getdata()
+csr_data.append(data)
+dns_data.append(data.todense())
+num_batch += 1
+bag_of_data = [csr_data, dns_data]
+num_repeat = 5
+costs = []
+for d in bag_of_data:
+weight.wait_to_read()
+cost = 0.
+count = 0
+for d_batch in d:
+d_batch.wait_to_read()
+cost += measure_cost(True, num_repeat, mx.nd.dot, d_batch, 
weight)
+count += 1
+costs.append(cost/count)
+t_sparse = costs[0]
+t_dense = costs[1]
+ratio = t_dense / t_sparse
+print('density(%)\tn\tm\tk\tt_dense/t_sparse\tt_dense\tt_sparse')
+fmt = "%0.4f\t\t%d\t%d\t%d\t%0.2f\t\t\t%0.4f\t%0.6f"
+print(fmt % (density * 100, batch_size, m, k, ratio, t_dense, 
t_sparse))
+
+
+def test_dot_synthetic():
+"""benchmark sparse mxnet dot and scipy dot operator with matrices of 
given density.
+`t_sparse` is the runtime of the invoked sparse dot operator in ms, while 
`t_dense` is the 
+runtime of dot(dns, dns), with the same matrices except that they are in 
default storage type.
+"""
+# Benchmark MXNet's sparse dot operator
+def bench_mx_dot(lhs_shape, rhs_shape, lhs_stype, rhs_stype, lhs_den, 
rhs_den, trans_lhs, ctx, repeat):
+set_default_context(ctx)
+# Create matrix instances
+lhs_nd = rand_ndarray(lhs_shape, lhs_stype, density=lhs_den)
+rhs_nd = rand_ndarray(rhs_shape, rhs_stype, density=rhs_den)
+lhs_dns = lhs_nd if lhs_stype == 'default' else lhs_nd.todense()
+rhs_dns = rhs_nd if rhs_stype == 'default' else rhs_nd.todense()
+# One warm up run, verify correctness
+

[GitHub] stefanhenneking commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-09 Thread git
stefanhenneking commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132255400
 
 

 ##
 File path: benchmark/python/dot.py
 ##
 @@ -0,0 +1,265 @@
+import ctypes
+
+from mxnet.test_utils import *
+import scipy.sparse as sp
+import os
+import time
+import argparse
+
+from mxnet.base import check_call, _LIB
+from util import get_data, estimate_density
+
+parser = argparse.ArgumentParser(description="Benchmark sparse operators",
+ 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--num-omp-threads', type=int, default=1, help='number of 
omp threads to set in MXNet')
+args = parser.parse_args()
+
+# some data information
+kdda = {
+'data_mini': 'kdda.t.mini',
+'data_name': 'kdda.t',
+'data_origin_name': 'kdda.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/kdda.t.bz2;,
+'feature_dim': 20216830,
+'m': 200,
+'batch_size': [64]
+}
+
+avazu = {
+'data_mini': 'avazu-app.t.mini',
+'data_name': 'avazu-app.t',
+'data_origin_name': 'avazu-app.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/avazu-app.t.bz2;,
+'feature_dim': 100,
+'m': 500,
+'batch_size': [64, 128]
+}
+
+
+def measure_cost(wait, repeat, f, *args, **kwargs):
 
 Review comment:
   good point. will change it to that.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #7347: Tensorcore conv deconv support

2017-08-09 Thread git
piiswrong commented on a change in pull request #7347: Tensorcore conv deconv 
support
URL: https://github.com/apache/incubator-mxnet/pull/7347#discussion_r132253228
 
 

 ##
 File path: src/operator/cudnn_algoreg-inl.h
 ##
 @@ -40,12 +65,17 @@ class CuDNNAlgoReg {
 oss << "cudnn_data_type=" << cudnn_data_type << ";";
 oss << "cudnn_forward_compute_type=" << cudnn_forward_compute_type << ";";
 oss << "cudnn_backward_compute_type=" << cudnn_backward_compute_type << 
";";
+// A system could be heterogeneous and thus have different algo choices 
for different
+// device ids.  'device_id' could possibly be replaced with gpu compute 
capability,
+// but identical GPUs could technically have different clock settings.
+oss << "device_id=" << device_id << ";";
 
 Review comment:
   This will be run in every iteration in imperative mode
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] craftit commented on issue #7399: Remove inline keyword from methods we want to generate code for.

2017-08-09 Thread git
craftit commented on issue #7399: Remove inline keyword from methods we want to 
generate code for.
URL: https://github.com/apache/incubator-mxnet/pull/7399#issuecomment-321324943
 
 
   Essentially the hpp files could be renamed .cpp files.  To use this library 
I just include all the .hpp header files into a single source file in my 
project.   In many ways that works quite well. 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] reminisce commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-09 Thread git
reminisce commented on a change in pull request #7226: Extending the GPU dot 
operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132054842
 
 

 ##
 File path: benchmark/python/dot.py
 ##
 @@ -0,0 +1,265 @@
+import ctypes
+
+from mxnet.test_utils import *
+import scipy.sparse as sp
+import os
+import time
+import argparse
+
+from mxnet.base import check_call, _LIB
+from util import get_data, estimate_density
+
+parser = argparse.ArgumentParser(description="Benchmark sparse operators",
+ 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--num-omp-threads', type=int, default=1, help='number of 
omp threads to set in MXNet')
+args = parser.parse_args()
+
+# some data information
+kdda = {
+'data_mini': 'kdda.t.mini',
+'data_name': 'kdda.t',
+'data_origin_name': 'kdda.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/kdda.t.bz2;,
+'feature_dim': 20216830,
+'m': 200,
+'batch_size': [64]
+}
+
+avazu = {
+'data_mini': 'avazu-app.t.mini',
+'data_name': 'avazu-app.t',
+'data_origin_name': 'avazu-app.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/avazu-app.t.bz2;,
+'feature_dim': 100,
+'m': 500,
+'batch_size': [64, 128]
+}
+
+
+def measure_cost(wait, repeat, f, *args, **kwargs):
+start = time.time()
+if wait:
+for i in range(repeat):
+(f(*args, **kwargs)).wait_to_read()
+else:
+for i in range(repeat):
+f(*args, **kwargs)
+end = time.time()
+diff = end - start
+return diff / repeat
+
+
+def test_dot_real(data_dict):
+def get_iter(path, data_shape, batch_size):
+data_train = mx.io.LibSVMIter(data_libsvm=path,
+  data_shape=data_shape,
+  batch_size=batch_size)
+data_iter = iter(data_train)
+return data_iter
+
+data_dir = os.path.join(os.getcwd(), 'data')
+
+path = os.path.join(data_dir, data_dict['data_name'])
+if not os.path.exists(path):
+get_data(
+data_dir,
+data_dict['data_name'],
+data_dict['url'],
+data_dict['data_origin_name']
+)
+assert os.path.exists(path)
+
+k = data_dict['feature_dim']
+m = data_dict['m']
+density = estimate_density(path, data_dict['feature_dim'])
+
+mini_path = os.path.join(data_dir, data_dict['data_mini'])
+if not os.path.exists(mini_path):
+os.system("head -n 2000 %r > %r" % (path, mini_path))
+assert os.path.exists(mini_path)
+
+print "Running Benchmarking on %r data" % data_dict['data_mini']
+for batch_size in data_dict['batch_size']:  # iterator through different 
batch size of choice
+print "batch_size is %d" % batch_size
+# model
+data_shape = (k, )
+train_iter = get_iter(mini_path, data_shape, batch_size)
+weight = mx.nd.random_uniform(low=0, high=1, shape=(k, m))
+
+csr_data = []
+dns_data = []
+num_batch = 0
+for batch in train_iter:
+data = train_iter.getdata()
+csr_data.append(data)
+dns_data.append(data.todense())
+num_batch += 1
+bag_of_data = [csr_data, dns_data]
+num_repeat = 5
+costs = []
+for d in bag_of_data:
+weight.wait_to_read()
+cost = 0.
+count = 0
+for d_batch in d:
+d_batch.wait_to_read()
+cost += measure_cost(True, num_repeat, mx.nd.dot, d_batch, 
weight)
+count += 1
+costs.append(cost/count)
+t_sparse = costs[0]
+t_dense = costs[1]
+ratio = t_dense / t_sparse
+print('density(%)\tn\tm\tk\tt_dense/t_sparse\tt_dense\tt_sparse')
+fmt = "%0.4f\t\t%d\t%d\t%d\t%0.2f\t\t\t%0.4f\t%0.6f"
+print(fmt % (density * 100, batch_size, m, k, ratio, t_dense, 
t_sparse))
+
+
+def test_dot_synthetic():
+"""benchmark sparse mxnet dot and scipy dot operator with matrices of 
given density.
+`t_sparse` is the runtime of the invoked sparse dot operator in ms, while 
`t_dense` is the 
+runtime of dot(dns, dns), with the same matrices except that they are in 
default storage type.
+"""
+# Benchmark MXNet's sparse dot operator
+def bench_mx_dot(lhs_shape, rhs_shape, lhs_stype, rhs_stype, lhs_den, 
rhs_den, trans_lhs, ctx, repeat):
+set_default_context(ctx)
+# Create matrix instances
+lhs_nd = rand_ndarray(lhs_shape, lhs_stype, density=lhs_den)
+rhs_nd = rand_ndarray(rhs_shape, rhs_stype, density=rhs_den)
+lhs_dns = lhs_nd if lhs_stype == 'default' else lhs_nd.todense()
+rhs_dns = rhs_nd if rhs_stype == 'default' else rhs_nd.todense()
+# One warm up run, verify correctness
+out = 

[GitHub] piiswrong commented on issue #7399: Remove inline keyword from methods we want to generate code for.

2017-08-09 Thread git
piiswrong commented on issue #7399: Remove inline keyword from methods we want 
to generate code for.
URL: https://github.com/apache/incubator-mxnet/pull/7399#issuecomment-321322573
 
 
   I doubt this will compile without the inline. This will cause multiple 
definitions.
   
   @lx75249 Why are definitions in header file?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] craftit opened a new pull request #7399: Remove inline keyword from methods we want to generate code for.

2017-08-09 Thread git
craftit opened a new pull request #7399: Remove inline keyword from methods we 
want to generate code for.
URL: https://github.com/apache/incubator-mxnet/pull/7399
 
 
   When linking to a larger c++ project we want to generate code for all the 
methods in the .hpp files, the inline keyword prevents this and causes 
undefined symbols. The compiler normally uses it's own heuristics for inlining 
code, so this is unlikely to have any impact on the code generated.  
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on a change in pull request #7395: Drafted documentation for autograd.

2017-08-09 Thread git
szha commented on a change in pull request #7395: Drafted documentation for 
autograd. 
URL: https://github.com/apache/incubator-mxnet/pull/7395#discussion_r132245300
 
 

 ##
 File path: docs/api/python/autograd.md
 ##
 @@ -9,6 +9,78 @@
 .. warning:: This package is currently experimental and may change in the near 
future.
 ```
 
+## Overview
+
+The ``autograd`` package consists of functions that enable automatic
+differentiation of scalar values with respect to NDArrays.
+For example, in machine learning applications,
+``autograd`` is often used to calculate the gradients
+of loss functions with respect to parameters.
+
+While automatic differentiation was previously available
+through the symbolic API, ``autograd`` works in the fully imperative context.
+In other words, we can just work with NDArrays
+and do not need to specify a computational graph a priori
+in order to take gradients.
+Of course, in order to differentiate a value ``y`` with respect
+to an NDArray ``x``, we need to know how
+the value of ``y`` depends on ``x``.
+You might wonder, how does ``autograd`` do this
+without a pre-specified computation graph?
+
+
+The trick here is that ``autograd`` builds a computation graph on the fly.
+When we calculate ``y = f(x)``, MXNet can remember
+how the value of ``y`` relates to ``x``.
+It's as if MXNet turned on a tape recorder to keep track of
+how each value was generated.
+To indicate to MXNet that we want to turn on the metaphorical tape recorder,
+all we have to do is place the code in a ``with autograd.record():`` block.
+For any variable ``x`` where we might later want to access its gradient,
+we can call ``x.attach_grad`` to allocate its space.
+Then once we calculate the value of a function ``y``
+inside a ``with autograd.record()`` block, we can call ``y.backward()``.
+
+```python
+>>> x = mx.nd.array([1,2,3,4])
+>>> x.attach_grad()
+>>> with mx.autograd.record():
+y = x * x
+>>> print(x.grad)
+>>>[ 2.  4.  6.  8.]
+
+```
+
+### ``Train_mode`` and ``predict_mode``
+
+Often, we want to define functions that behave differently
+when we are training models vs making predictions.
+By default, MXNet assumes we are in predict mode.
+However, usually when we take gradients, we are in the process of training.
+MXNet let's us decouple *training* vs *predict_mode* from
+*recording* vs *not recording*.
+
+When we turn on autograd, this by default turns on train_mode
+(``with autograd.record(train_mode=True):``).
+To change this default behavior (as when generating adversarial examples),
+we can optionally call record by (``with autograd.record(train_mode=False):``).
+
+Additionally we can override the current score and elicit train or predict
+behaviors for some lines of code by placing them
+in a ``with autograd.train_mode():`` or ``with autograd.predict_mode():``
+block, respectively.
+This is especially for turning dropout layers on and off
+at prediction, as is popular for generating uncertainty estimates.
+
+
+Detailed tutorials are available in Part 1 of
+[the MXNet gluon book](http://gluon.mxnet.io/).
 
 Review comment:
   We should either add reference to the book in all gluon module description 
pages or none of them.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on a change in pull request #7395: Drafted documentation for autograd.

2017-08-09 Thread git
szha commented on a change in pull request #7395: Drafted documentation for 
autograd. 
URL: https://github.com/apache/incubator-mxnet/pull/7395#discussion_r132244948
 
 

 ##
 File path: docs/api/python/autograd.md
 ##
 @@ -9,6 +9,78 @@
 .. warning:: This package is currently experimental and may change in the near 
future.
 ```
 
+## Overview
+
+The ``autograd`` package consists of functions that enable automatic
+differentiation of scalar values with respect to NDArrays.
+For example, in machine learning applications,
+``autograd`` is often used to calculate the gradients
+of loss functions with respect to parameters.
+
+While automatic differentiation was previously available
+through the symbolic API, ``autograd`` works in the fully imperative context.
+In other words, we can just work with NDArrays
+and do not need to specify a computational graph a priori
+in order to take gradients.
+Of course, in order to differentiate a value ``y`` with respect
+to an NDArray ``x``, we need to know how
+the value of ``y`` depends on ``x``.
+You might wonder, how does ``autograd`` do this
+without a pre-specified computation graph?
+
+
+The trick here is that ``autograd`` builds a computation graph on the fly.
+When we calculate ``y = f(x)``, MXNet can remember
+how the value of ``y`` relates to ``x``.
+It's as if MXNet turned on a tape recorder to keep track of
+how each value was generated.
+To indicate to MXNet that we want to turn on the metaphorical tape recorder,
+all we have to do is place the code in a ``with autograd.record():`` block.
+For any variable ``x`` where we might later want to access its gradient,
+we can call ``x.attach_grad`` to allocate its space.
+Then once we calculate the value of a function ``y``
+inside a ``with autograd.record()`` block, we can call ``y.backward()``.
+
+```python
+>>> x = mx.nd.array([1,2,3,4])
+>>> x.attach_grad()
+>>> with mx.autograd.record():
+y = x * x
+>>> print(x.grad)
+>>>[ 2.  4.  6.  8.]
+
+```
+
+### ``Train_mode`` and ``predict_mode``
+
+Often, we want to define functions that behave differently
+when we are training models vs making predictions.
+By default, MXNet assumes we are in predict mode.
+However, usually when we take gradients, we are in the process of training.
+MXNet let's us decouple *training* vs *predict_mode* from
+*recording* vs *not recording*.
 
 Review comment:
   Users might not be aware of the coupling, since `record(train_mode=True)` is 
the default form of record.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] eric-haibin-lin commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-09 Thread git
eric-haibin-lin commented on a change in pull request #7226: Extending the GPU 
dot operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132243679
 
 

 ##
 File path: benchmark/python/dot.py
 ##
 @@ -0,0 +1,265 @@
+import ctypes
+
+from mxnet.test_utils import *
+import scipy.sparse as sp
+import os
+import time
+import argparse
+
+from mxnet.base import check_call, _LIB
+from util import get_data, estimate_density
+
+parser = argparse.ArgumentParser(description="Benchmark sparse operators",
+ 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--num-omp-threads', type=int, default=1, help='number of 
omp threads to set in MXNet')
+args = parser.parse_args()
+
+# some data information
+kdda = {
+'data_mini': 'kdda.t.mini',
+'data_name': 'kdda.t',
+'data_origin_name': 'kdda.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/kdda.t.bz2;,
+'feature_dim': 20216830,
+'m': 200,
+'batch_size': [64]
+}
+
+avazu = {
+'data_mini': 'avazu-app.t.mini',
+'data_name': 'avazu-app.t',
+'data_origin_name': 'avazu-app.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/avazu-app.t.bz2;,
+'feature_dim': 100,
+'m': 500,
+'batch_size': [64, 128]
+}
+
+
+def measure_cost(wait, repeat, f, *args, **kwargs):
 
 Review comment:
   We can always call `mx.nd.waitall()` to ensure all mxnet async operation are 
done. This won't affect scipy performance. 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] terrychenism commented on issue #6682: pre-trained resnext model doesn't work

2017-08-09 Thread git
terrychenism commented on issue #6682: pre-trained resnext model doesn't work
URL: 
https://github.com/apache/incubator-mxnet/issues/6682#issuecomment-321293399
 
 
   @coolbrain Yes, we can reproduce resnext-101 result 78.8 using imageiter and 
fb-style augmentation 
(https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/image/image.py#L821)
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] githubfragments commented on issue #6991: I used pip and anaconda2 to install MXNet, and now how can I install torch plugin?

2017-08-09 Thread git
githubfragments commented on issue #6991: I used pip and anaconda2 to install 
MXNet, and now how can I install torch plugin?
URL: 
https://github.com/apache/incubator-mxnet/issues/6991#issuecomment-321287695
 
 
   Do you successfully use torch for Mxnet?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] githubfragments commented on issue #4851: error: ISO C++ forbids comparison between pointer and integer

2017-08-09 Thread git
githubfragments commented on issue #4851: error: ISO C++ forbids comparison 
between pointer and integer
URL: 
https://github.com/apache/incubator-mxnet/issues/4851#issuecomment-321285856
 
 
   Is there any versions of Torch we can use? @piiswrong 
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coolbrain commented on issue #6682: pre-trained resnext model doesn't work

2017-08-09 Thread git
coolbrain commented on issue #6682: pre-trained resnext model doesn't work
URL: 
https://github.com/apache/incubator-mxnet/issues/6682#issuecomment-321281288
 
 
   @terrychenism  I trained the resnext model according to the training log you 
shared.  You first use 480 shorter side of image to train the model which can 
add more training data compared to 256, after 100 epochs, you use the 256 
shorter side to  improve accuracy.  The top-1 of resnext-50 is 76.8%. But the 
top-1 of resnext-50 is 77.8% in Resnext paper implemented in Torch and the 
paper says they just use shorter side 256.  Can Mxnet has performance as good 
as  Torch?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pras1406 commented on issue #7397: OSError: /home/c244728_lx/mxnet/mxnet/python/mxnet/../../lib/libmxnet.so: undefined symbol: cblas_ddot

2017-08-09 Thread git
pras1406 commented on issue #7397: OSError: 
/home/c244728_lx/mxnet/mxnet/python/mxnet/../../lib/libmxnet.so: undefined 
symbol: cblas_ddot
URL: 
https://github.com/apache/incubator-mxnet/issues/7397#issuecomment-321279681
 
 
   Tried to buld OpenBLAS with DYNAMIC_ARCH=1 NO_AVX2=1 and then again 
rebuilded mxnet still giving the same error.
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pras1406 commented on issue #7397: OSError: /home/c244728_lx/mxnet/mxnet/python/mxnet/../../lib/libmxnet.so: undefined symbol: cblas_ddot

2017-08-09 Thread git
pras1406 commented on issue #7397: OSError: 
/home/c244728_lx/mxnet/mxnet/python/mxnet/../../lib/libmxnet.so: undefined 
symbol: cblas_ddot
URL: 
https://github.com/apache/incubator-mxnet/issues/7397#issuecomment-321279681
 
 
   Tried to build OpenBLAS with DYNAMIC_ARCH=1 NO_AVX2=1 and then again 
rebuilded mxnet still giving the same error.
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] kimtang commented on issue #7389: [R] im2rec in R. close #7273

2017-08-09 Thread git
kimtang commented on issue #7389: [R] im2rec in R. close #7273
URL: https://github.com/apache/incubator-mxnet/pull/7389#issuecomment-321277099
 
 
   Nice to see im2rec in R. I am just curious how long does it take for you to 
export the im2rec function to R?
   
   Kim
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] austingg commented on issue #7393: add depthwise convolution's gpu version optimization

2017-08-09 Thread git
austingg commented on issue #7393: add depthwise convolution's gpu version 
optimization
URL: https://github.com/apache/incubator-mxnet/pull/7393#issuecomment-321261481
 
 
   @solin319 , it is said grouped conv in cudnn v7 is not efficient when used 
in depthwise conv, where the group num == input channels
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] melody-rain commented on issue #5475: Difference between ImageIter and ImageRecordIter

2017-08-09 Thread git
melody-rain commented on issue #5475: Difference between ImageIter  and 
ImageRecordIter
URL: 
https://github.com/apache/incubator-mxnet/issues/5475#issuecomment-321249223
 
 
   I got the similar issue. Have you found any clues?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] idealboy commented on issue #7396: importerror: no module named Union

2017-08-09 Thread git
idealboy commented on issue #7396: importerror: no module named Union
URL: 
https://github.com/apache/incubator-mxnet/issues/7396#issuecomment-321223491
 
 
   Exception in thread Thread-4:
   Traceback (most recent call last):
 File "/data/anaconda/lib/python2.7/threading.py", line 810, in 
__bootstrap_inner
   self.run()
 File "/data/anaconda/lib/python2.7/threading.py", line 763, in run
   self.__target(*self.__args, **self.__kwargs)
 File 
"/data/work/mxnetfollow-dist/tools/../dmlc-core/tracker/dmlc_tracker/ssh.py", 
line 60, in run
   subprocess.check_call(prog, shell = True)
 File "/data/anaconda/lib/python2.7/subprocess.py", line 540, in check_call
   raise CalledProcessError(retcode, cmd)
   CalledProcessError: Command 'ssh -o StrictHostKeyChecking=no 10.15.133.82 -p 
22 'export LD_LIBRARY_PATH
   
   export DMLC_SERVER_ID=1; export DMLC_WORKER_ID=0; export 
DMLC_PS_ROOT_URI=10.15.240.189; export DMLC_ROLE=worker; export 
DMLC_PS_ROOT_PORT=9118; export DMLC_NUM_WORKER=2; export DMLC_NUM_SERVER=2; cd 
/tmp/mxnet; python train_mnist.py --network lenet --gpus 0,1 --kv-store 
dist_sync'' returned non-zero exit status 255
   
   
   
   
   
   
   When training on dist-sync? the error occurs? why? Thank you very much
   
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pras1406 opened a new issue #7397: OSError: /home/c244728_lx/mxnet/mxnet/python/mxnet/../../lib/libmxnet.so: undefined symbol: cblas_ddot

2017-08-09 Thread git
pras1406 opened a new issue #7397: OSError: 
/home/c244728_lx/mxnet/mxnet/python/mxnet/../../lib/libmxnet.so: undefined 
symbol: cblas_ddot
URL: https://github.com/apache/incubator-mxnet/issues/7397
 
 
   For bugs or installation issues, please provide the following information.
   The more information you provide, the more likely people will be able to 
help you.
   
   ## Environment info
   Operating System:
   RHEL 6.9 (2.6.32-696.el6.x86_64)
   Compiler:
   
   Package used (Python/R/Scala/Julia):
   Python
   
   MXNet version:
   
   Or if installed from source:
git clone --recursive https://github.com/dmlc/mxnet (Installed from source)
   
   MXNet commit hash (`git rev-parse HEAD`):
   
   If you are using python package, please provide
   
   Python version and distribution:
   Python 2.7.10
   
   If you are using R package, please provide
   
   R `sessionInfo()`:
   
   ## Error Message:
   Please paste the full error message, including stack trace.
   I have installed mxnet at this dir: ~/mxnet/mxnet
   PYTHONPATH is set to ~/mxnet/mxnet/python
   
   A. OpenBLAS used:
   1. git clone "git://github.com/xianyi/OpenBLAS.git"
   2. cd OpenBLAS
   3. make TARGET=SANDYBRIDGE ( our processor is Intel(R) Xeon(R) CPU E5-2680 
v3 @ 2.50GHz which is haswell but it was giving this error with `make` command 
./kernel/x86_64/dtrmm_kernel_4x8_haswell.c:77: Error: no such instruction: vpe 
rmpd $0x1b,%ymm3,%ymm3' ../kernel/x86_64/dtrmm_kernel_4x8_haswell.c:78: Error: 
no such instruction:vpe rmpd $0xb1,%ymm2,%ymm2') So I changed TARGET=SANDYBRIDE
   
   4. Installed OpenBLAS with make PREFIX=dir install
   
   B.
   1.  Installed mxnet with USE_BLAS=openblas and USE_OPENCV=0 and specifying 
path of OpenBLAS in mxnet/make/config.mk file.
   2. make -j4 (Successful as it generated lib/libmxnet.a and libmxnet.so)
   3. export PYTHONPATH=~/mxnet/mxnet/python/
   4.  Ran python in interactive mode as
   [c244728_lx@host1]$ module load gcc/5.3.0
   [c244728_lx@host1]$ python
   Python 2.7.10 (default, Jun  6 2015, 14:08:03)
   [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import mxnet as mx
   Traceback (most recent call last):
 File "", line 1, in 
 File "/home/c244728_lx/mxnet/mxnet/python/mxnet/__init__.py", line 7, in 

   from .base import MXNetError
 File "/home/c244728_lx/mxnet/mxnet/python/mxnet/base.py", line 69, in 

   _LIB = _load_lib()
 File "/home/c244728_lx/mxnet/mxnet/python/mxnet/base.py", line 61, in 
_load_lib
   lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
 File "/lrlhps/apps/python/python-2.7.10/lib/python2.7/ctypes/__init__.py", 
line 365, in __init__
   self._handle = _dlopen(self._name, mode)
   OSError: /home/c244728_lx/mxnet/mxnet/python/mxnet/../../lib/libmxnet.so: 
undefined symbol: cblas_ddot
   >>>
   
   
   ## Minimum reproducible example
   if you are using your own code, please provide a short script that 
reproduces the error.
   Also ran mxnet/example/ as
   [c244728_lx@host1 mxnet]$ python example/image-classification/train_mnist.py
   Traceback (most recent call last):
 File "example/image-classification/train_mnist.py", line 8, in 
   from common import find_mxnet, fit
 File 
"/home/c244728_lx/mxnet/mxnet/example/image-classification/common/find_mxnet.py",
 line 3, in 
   import mxnet as mx
 File "/home/c244728_lx/mxnet/mxnet/python/mxnet/__init__.py", line 7, in 

   from .base import MXNetError
 File "/home/c244728_lx/mxnet/mxnet/python/mxnet/base.py", line 69, in 

   _LIB = _load_lib()
 File "/home/c244728_lx/mxnet/mxnet/python/mxnet/base.py", line 61, in 
_load_lib
   lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
 File "/lrlhps/apps/python/python-2.7.10/lib/python2.7/ctypes/__init__.py", 
line 365, in __init__
   self._handle = _dlopen(self._name, mode)
   OSError: /home/c244728_lx/mxnet/mxnet/python/mxnet/../../lib/libmxnet.so: 
undefined symbol: cblas_ddot
   
   ## Steps to reproduce
   or if you are running standard examples, please provide the commands you 
have run that lead to the error.
   
   1.
   2.
   3.
   
   ## What have you tried to solve it?
   
   1.
   2.
   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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] BenLag2906 commented on issue #7362: import mxnet errors

2017-08-09 Thread git
BenLag2906 commented on issue #7362: import mxnet errors
URL: 
https://github.com/apache/incubator-mxnet/issues/7362#issuecomment-321210552
 
 
   Hi,
   
   I have the same problem when i try to import package under python : 
   
   
   Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 
bit (AMD64)] on win32
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import mxnet
   Traceback (most recent call last):
 File "", line 1, in 
 File "mxnet\__init__.py", line 25, in 
   from .base import MXNetError
 File "mxnet\base.py", line 86, in 
   _LIB = _load_lib()
 File "mxnet\base.py", line 78, in _load_lib
   lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
 File "C:\Python27\lib\ctypes\__init__.py", line 362, in __init__
   self._handle = _dlopen(self._name, mode)
   WindowsError: [Error 126] Le module sp?cifi? est introuvable
   **
   
   I recompiling this morning with the HEAD.
   
   And I launch the command after compilation: 'python setup.py install'
   
   I work on windows 10.
   
   Could you please give an advise ?
   
   regards
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] crazy-cat commented on a change in pull request #7393: add depthwise convolution's gpu version optimization

2017-08-09 Thread git
crazy-cat commented on a change in pull request #7393: add depthwise 
convolution's gpu version optimization
URL: https://github.com/apache/incubator-mxnet/pull/7393#discussion_r132136675
 
 

 ##
 File path: src/operator/depthwise_convolution-inl.h
 ##
 @@ -0,0 +1,346 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*!
+ * \file depthwise_convolution-inl.h
+ * \brief CUDA depthwise convolution code
+ * \author shuqian...@hobot.cc
+*/
+#ifndef MXNET_OPERATOR_DEPTHWISE_CONVOLUTION_INL_H_
+#define MXNET_OPERATOR_DEPTHWISE_CONVOLUTION_INL_H_
+#include 
+#include 
+#include "./convolution-inl.h"
+#include "../common/cuda_utils.h"
+
+#if MXNET_USE_CUDA
+#include 
+#include "./depthwise_convolution_tf.cuh"
+
+namespace mxnet {
+namespace op {
+using namespace tf::depthwise_conv;
+template
+class DepthwiseConvolutionOp : public Operator {
+ public:
+  explicit DepthwiseConvolutionOp(const ConvolutionParam& param,
+  const std::vector& in_shape,
+  const std::vector& out_shape) {
+args_.batch = in_shape[conv::kData][0];
+args_.in_channel = in_shape[conv::kData][1];
+args_.in_height = in_shape[conv::kData][2];
+args_.in_width = in_shape[conv::kData][3];
+args_.filter_height = in_shape[conv::kWeight][2];
+args_.filter_width = in_shape[conv::kWeight][3];
+args_.stride_height = param.stride[0];
+args_.stride_width = param.stride[1];
+args_.pad_height = param.pad[0];
+args_.pad_width = param.pad[1];
+args_.out_channel = out_shape[conv::kOut][1];
+args_.out_height = out_shape[conv::kOut][2];
+args_.out_width = out_shape[conv::kOut][3];
+bias_term_ = !param.no_bias;
+  }
+
+  ~DepthwiseConvolutionOp() {}
+
+  virtual void Forward(const OpContext ,
+   const std::vector _data,
+   const std::vector ,
+   const std::vector _data,
+   const std::vector _args);
+
+  virtual void Backward(const OpContext ,
+const std::vector _grad,
+const std::vector _data,
+const std::vector _data,
+const std::vector ,
+const std::vector _grad,
+const std::vector _args);
+
+ private:
+  DepthwiseArgs args_;
+  bool bias_term_;
+};  // class DepthwiseConvolutionOp
+
+namespace depthwise_conv {
+namespace cuda {
+template
+__global__ void __launch_bounds__(1024, 2)
+DepthwiseConv2dBackwardFilterKernel(const DepthwiseArgs args,
 
 Review comment:
   Yes, we have test that. The tf version is just atomicAdd by all threads. 
   The cross-border judgement is in line 135-138.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] crazy-cat commented on a change in pull request #7393: add depthwise convolution's gpu version optimization

2017-08-09 Thread git
crazy-cat commented on a change in pull request #7393: add depthwise 
convolution's gpu version optimization
URL: https://github.com/apache/incubator-mxnet/pull/7393#discussion_r132129057
 
 

 ##
 File path: src/operator/depthwise_convolution-inl.h
 ##
 @@ -0,0 +1,346 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*!
+ * \file depthwise_convolution-inl.h
+ * \brief CUDA depthwise convolution code
+ * \author shuqian...@hobot.cc
+*/
+#ifndef MXNET_OPERATOR_DEPTHWISE_CONVOLUTION_INL_H_
+#define MXNET_OPERATOR_DEPTHWISE_CONVOLUTION_INL_H_
+#include 
+#include 
+#include "./convolution-inl.h"
+#include "../common/cuda_utils.h"
+
+#if MXNET_USE_CUDA
+#include 
+#include "./depthwise_convolution_tf.cuh"
+
+namespace mxnet {
+namespace op {
+using namespace tf::depthwise_conv;
+template
+class DepthwiseConvolutionOp : public Operator {
+ public:
+  explicit DepthwiseConvolutionOp(const ConvolutionParam& param,
+  const std::vector& in_shape,
+  const std::vector& out_shape) {
+args_.batch = in_shape[conv::kData][0];
+args_.in_channel = in_shape[conv::kData][1];
+args_.in_height = in_shape[conv::kData][2];
+args_.in_width = in_shape[conv::kData][3];
+args_.filter_height = in_shape[conv::kWeight][2];
+args_.filter_width = in_shape[conv::kWeight][3];
+args_.stride_height = param.stride[0];
+args_.stride_width = param.stride[1];
+args_.pad_height = param.pad[0];
+args_.pad_width = param.pad[1];
+args_.out_channel = out_shape[conv::kOut][1];
+args_.out_height = out_shape[conv::kOut][2];
+args_.out_width = out_shape[conv::kOut][3];
+bias_term_ = !param.no_bias;
+  }
+
+  ~DepthwiseConvolutionOp() {}
+
+  virtual void Forward(const OpContext ,
+   const std::vector _data,
+   const std::vector ,
+   const std::vector _data,
+   const std::vector _args);
+
+  virtual void Backward(const OpContext ,
+const std::vector _grad,
+const std::vector _data,
+const std::vector _data,
+const std::vector ,
+const std::vector _grad,
+const std::vector _args);
+
+ private:
+  DepthwiseArgs args_;
+  bool bias_term_;
+};  // class DepthwiseConvolutionOp
+
+namespace depthwise_conv {
+namespace cuda {
+template
+__global__ void __launch_bounds__(1024, 2)
+DepthwiseConv2dBackwardFilterKernel(const DepthwiseArgs args,
 
 Review comment:
   In depthwise_convolution_tf.cuh, the cuda kernel's main logic are from 
tensorflow, but this kernel is done by us alone, so we keep it in mxnet 
namespace.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] solin319 commented on issue #7393: add depthwise convolution's gpu version optimization

2017-08-09 Thread git
solin319 commented on issue #7393: add depthwise convolution's gpu version 
optimization
URL: https://github.com/apache/incubator-mxnet/pull/7393#issuecomment-321196633
 
 
   @piiswrong When will mxnet support cudnn-v7? Grouped Convolutions was 
included in this version.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] crazy-cat commented on a change in pull request #7393: add depthwise convolution's gpu version optimization

2017-08-09 Thread git
crazy-cat commented on a change in pull request #7393: add depthwise 
convolution's gpu version optimization
URL: https://github.com/apache/incubator-mxnet/pull/7393#discussion_r132126568
 
 

 ##
 File path: src/common/cuda_utils.h
 ##
 @@ -175,6 +185,18 @@ inline const char* CurandGetErrorString(curandStatus_t 
status) {
 << "cuRAND: " << common::cuda::CurandGetErrorString(e); \
   }
 
+#define CUDA_1D_KERNEL_LOOP(i, n)\
 
 Review comment:
   OK
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] idealboy opened a new issue #7396: importerror: no module named Union

2017-08-09 Thread git
idealboy opened a new issue #7396: importerror: no module named Union
URL: https://github.com/apache/incubator-mxnet/issues/7396
 
 
   For bugs or installation issues, please provide the following information.
   The more information you provide, the more likely people will be able to 
help you.
   
   ## Environment info
   Operating System:
   centos6.4
   Compiler:
   gcc-4.8.5
   Package used (Python/R/Scala/Julia):
   python
   MXNet version:
   0.9.5
   Or if installed from source:
   Yes
   MXNet commit hash (`git rev-parse HEAD`):
   
   If you are using python package, please provide
   anaconda-python-2.7
   Python version and distribution:
   anaconda-python-2.7
   If you are using R package, please provide
   
   R `sessionInfo()`:
   
   ## Error Message:
   Please paste the full error message, including stack trace.
   
   ## Minimum reproducible example
   if you are using your own code, please provide a short script that 
reproduces the error.
   
   ## Steps to reproduce
   or if you are running standard examples, please provide the commands you 
have run that lead to the error.
   
   1.
   2.
   3.
   
   ## What have you tried to solve it?
   
   1.
   2.
   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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nejyeah commented on issue #7394: Cannot find custom operator type BoxAnnotatorOHEM

2017-08-09 Thread git
nejyeah commented on issue #7394: Cannot find custom operator type 
BoxAnnotatorOHEM
URL: 
https://github.com/apache/incubator-mxnet/issues/7394#issuecomment-321186621
 
 
   My mistake!! Forget to include the "BoxAnnotatorOHEM" file
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nejyeah closed issue #7394: Cannot find custom operator type BoxAnnotatorOHEM

2017-08-09 Thread git
nejyeah closed issue #7394: Cannot find custom operator type BoxAnnotatorOHEM
URL: https://github.com/apache/incubator-mxnet/issues/7394
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coolbrain commented on issue #6999: bgr or rgb input to vgg16?

2017-08-09 Thread git
coolbrain commented on issue #6999: bgr or rgb input to vgg16?
URL: 
https://github.com/apache/incubator-mxnet/issues/6999#issuecomment-321173914
 
 
   I had confirmed that VGG16 pre-trained model is directly converted from 
caffe model. In mxnet, the input channel of image is RGB, but BGR in caffe, so 
when converting the model, it adjusts the first convolution kernel sequence, so 
the result may be right.
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing closed pull request #7389: [R] im2rec in R. close #7273

2017-08-09 Thread git
thirdwing closed pull request #7389: [R] im2rec in R. close #7273
URL: https://github.com/apache/incubator-mxnet/pull/7389
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] thirdwing closed issue #7273: [R] call im2rec in R

2017-08-09 Thread git
thirdwing closed issue #7273: [R] call im2rec in R
URL: https://github.com/apache/incubator-mxnet/issues/7273
 
 
   
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-mxnet] branch master updated: [R] im2rec in R. close #7273 (#7389)

2017-08-09 Thread qkou
This is an automated email from the ASF dual-hosted git repository.

qkou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
 new 89e3ee3  [R] im2rec in R. close #7273 (#7389)
89e3ee3 is described below

commit 89e3ee3ea7c223db8c65ddd8c94c6e787d7c52df
Author: Qiang Kou (KK) 
AuthorDate: Wed Aug 9 06:44:58 2017 +

[R] im2rec in R. close #7273 (#7389)
---
 Makefile |   3 +-
 R-package/R/util.R   |  49 +-
 R-package/src/Makevars   |   2 +-
 R-package/src/export.cc  |   2 +-
 R-package/src/im2rec.cc  | 269 +++
 R-package/src/im2rec.h   |  42 +
 R-package/src/mxnet.cc   |   3 +
 R-package/vignettes/CatsDogsFinetune.Rmd |  55 ---
 8 files changed, 402 insertions(+), 23 deletions(-)

diff --git a/Makefile b/Makefile
index 5c7f54d..ed74214 100644
--- a/Makefile
+++ b/Makefile
@@ -379,6 +379,7 @@ rcpplint:
 rpkg:
mkdir -p R-package/inst
mkdir -p R-package/inst/libs
+   cp src/io/image_recordio.h R-package/src
cp -rf lib/libmxnet.so R-package/inst/libs
mkdir -p R-package/inst/include
cp -rf include/* R-package/inst/include
@@ -442,7 +443,7 @@ clean: cyclean $(EXTRA_PACKAGES_CLEAN)
 else
 clean: cyclean testclean $(EXTRA_PACKAGES_CLEAN)
$(RM) -r build lib bin *~ */*~ */*/*~ */*/*/*~ R-package/NAMESPACE 
R-package/man R-package/R/mxnet_generated.R \
-   R-package/inst R-package/src/*.o R-package/src/*.so 
mxnet_*.tar.gz
+   R-package/inst R-package/src/image_recordio.h R-package/src/*.o 
R-package/src/*.so mxnet_*.tar.gz
cd $(DMLC_CORE); $(MAKE) clean; cd -
cd $(PS_PATH); $(MAKE) clean; cd -
cd $(NNVM_PATH); $(MAKE) clean; cd -
diff --git a/R-package/R/util.R b/R-package/R/util.R
index 2b292d1..acc9510 100644
--- a/R-package/R/util.R
+++ b/R-package/R/util.R
@@ -9,5 +9,52 @@ mx.util.filter.null <- function(lst) {
 #'
 #' @export
 mxnet.export <- function(path) {
-  mxnet.internal.export(path.expand(path))
+  mx.internal.export(path.expand(path))
+}
+
+#' Convert images into image recordio format
+#' @param image_lst
+#'   The image lst file
+#' @param root
+#'   The root folder for image files
+#' @param output_rec
+#'   The output rec file
+#' @param label_width
+#'   The label width in the list file. Default is 1.
+#' @param pack_label
+#'   Whether to also pack multi dimenional label in the record file. Default 
is 0.
+#' @param new_size
+#'   The shorter edge of image will be resized to the newsize. 
+#'   Original images will be packed by default.
+#' @param nsplit
+#'   It is used for part generation, logically split the image.lst to NSPLIT 
parts by position.
+#'   Default is 1.
+#' @param partid
+#'   It is used for part generation, pack the images from the specific part in 
image.lst.
+#'   Default is 0.
+#' @param center_crop
+#'   Whether to crop the center image to make it square. Default is 0.
+#' @param quality
+#'   JPEG quality for encoding (1-100, default: 95) or PNG compression for 
encoding (1-9, default: 3).
+#' @param color_mode
+#'   Force color (1), gray image (0) or keep source unchanged (-1). Default is 
1.
+#' @param unchanged
+#'   Keep the original image encoding, size and color. If set to 1, it will 
ignore the others parameters.
+#' @param inter_method
+#'   NN(0), BILINEAR(1), CUBIC(2), AREA(3), LANCZOS4(4), AUTO(9), RAND(10). 
Default is 1.
+#' @param encoding
+#'   The encoding type for images. It can be '.jpg' or '.png'. Default is 
'.jpg'.
+#' @export
+im2rec <- function(image_lst, root, output_rec, label_width = 1L,
+   pack_label = 0L, new_size = -1L, nsplit = 1L,
+   partid = 0L, center_crop = 0L, quality = 95L,
+   color_mode = 1L, unchanged = 0L, inter_method = 1L,
+   encoding = ".jpg") {
+  image_lst <- path.expand(image_lst)
+  root <- path.expand(root)
+  output_rec <- path.expand(output_rec)
+  mx.internal.im2rec(image_lst, root, output_rec, label_width,
+ pack_label, new_size,  nsplit, partid,
+ center_crop, quality, color_mode, unchanged,
+ inter_method, encoding)
 }
diff --git a/R-package/src/Makevars b/R-package/src/Makevars
index a9cdabf..c089c09 100644
--- a/R-package/src/Makevars
+++ b/R-package/src/Makevars
@@ -1,3 +1,3 @@
-
+CXX_STD = CXX11
 PKG_CPPFLAGS = -I../inst/include
 PKG_LIBS =  $(LAPACK_LIBS) $(BLAS_LIBS)
diff --git a/R-package/src/export.cc b/R-package/src/export.cc
index 2377a02..ef77d25 100644
--- a/R-package/src/export.cc
+++ b/R-package/src/export.cc
@@ -41,7 +41,7 @@ Exporter* Exporter::Get() {
 void Exporter::InitRcppModule() {
   using namespace Rcpp;  // NOLINT(*)
   Exporter::Get()->scope_ = 

[GitHub] reminisce commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-09 Thread git
reminisce commented on a change in pull request #7226: Extending the GPU dot 
operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132054939
 
 

 ##
 File path: benchmark/python/dot.py
 ##
 @@ -0,0 +1,265 @@
+import ctypes
+
+from mxnet.test_utils import *
+import scipy.sparse as sp
+import os
+import time
+import argparse
+
+from mxnet.base import check_call, _LIB
+from util import get_data, estimate_density
+
+parser = argparse.ArgumentParser(description="Benchmark sparse operators",
+ 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--num-omp-threads', type=int, default=1, help='number of 
omp threads to set in MXNet')
+args = parser.parse_args()
+
+# some data information
+kdda = {
+'data_mini': 'kdda.t.mini',
+'data_name': 'kdda.t',
+'data_origin_name': 'kdda.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/kdda.t.bz2;,
+'feature_dim': 20216830,
+'m': 200,
+'batch_size': [64]
+}
+
+avazu = {
+'data_mini': 'avazu-app.t.mini',
+'data_name': 'avazu-app.t',
+'data_origin_name': 'avazu-app.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/avazu-app.t.bz2;,
+'feature_dim': 100,
+'m': 500,
+'batch_size': [64, 128]
+}
+
+
+def measure_cost(wait, repeat, f, *args, **kwargs):
+start = time.time()
+if wait:
+for i in range(repeat):
+(f(*args, **kwargs)).wait_to_read()
+else:
+for i in range(repeat):
+f(*args, **kwargs)
+end = time.time()
+diff = end - start
+return diff / repeat
+
+
+def test_dot_real(data_dict):
+def get_iter(path, data_shape, batch_size):
+data_train = mx.io.LibSVMIter(data_libsvm=path,
+  data_shape=data_shape,
+  batch_size=batch_size)
+data_iter = iter(data_train)
+return data_iter
+
+data_dir = os.path.join(os.getcwd(), 'data')
+
+path = os.path.join(data_dir, data_dict['data_name'])
+if not os.path.exists(path):
+get_data(
+data_dir,
+data_dict['data_name'],
+data_dict['url'],
+data_dict['data_origin_name']
+)
+assert os.path.exists(path)
+
+k = data_dict['feature_dim']
+m = data_dict['m']
+density = estimate_density(path, data_dict['feature_dim'])
+
+mini_path = os.path.join(data_dir, data_dict['data_mini'])
+if not os.path.exists(mini_path):
+os.system("head -n 2000 %r > %r" % (path, mini_path))
+assert os.path.exists(mini_path)
+
+print "Running Benchmarking on %r data" % data_dict['data_mini']
+for batch_size in data_dict['batch_size']:  # iterator through different 
batch size of choice
+print "batch_size is %d" % batch_size
+# model
+data_shape = (k, )
+train_iter = get_iter(mini_path, data_shape, batch_size)
+weight = mx.nd.random_uniform(low=0, high=1, shape=(k, m))
+
+csr_data = []
+dns_data = []
+num_batch = 0
+for batch in train_iter:
+data = train_iter.getdata()
+csr_data.append(data)
+dns_data.append(data.todense())
+num_batch += 1
+bag_of_data = [csr_data, dns_data]
+num_repeat = 5
+costs = []
+for d in bag_of_data:
+weight.wait_to_read()
+cost = 0.
+count = 0
+for d_batch in d:
+d_batch.wait_to_read()
+cost += measure_cost(True, num_repeat, mx.nd.dot, d_batch, 
weight)
+count += 1
+costs.append(cost/count)
+t_sparse = costs[0]
+t_dense = costs[1]
+ratio = t_dense / t_sparse
+print('density(%)\tn\tm\tk\tt_dense/t_sparse\tt_dense\tt_sparse')
+fmt = "%0.4f\t\t%d\t%d\t%d\t%0.2f\t\t\t%0.4f\t%0.6f"
+print(fmt % (density * 100, batch_size, m, k, ratio, t_dense, 
t_sparse))
+
+
+def test_dot_synthetic():
+"""benchmark sparse mxnet dot and scipy dot operator with matrices of 
given density.
+`t_sparse` is the runtime of the invoked sparse dot operator in ms, while 
`t_dense` is the 
+runtime of dot(dns, dns), with the same matrices except that they are in 
default storage type.
+"""
+# Benchmark MXNet's sparse dot operator
+def bench_mx_dot(lhs_shape, rhs_shape, lhs_stype, rhs_stype, lhs_den, 
rhs_den, trans_lhs, ctx, repeat):
+set_default_context(ctx)
+# Create matrix instances
+lhs_nd = rand_ndarray(lhs_shape, lhs_stype, density=lhs_den)
+rhs_nd = rand_ndarray(rhs_shape, rhs_stype, density=rhs_den)
+lhs_dns = lhs_nd if lhs_stype == 'default' else lhs_nd.todense()
+rhs_dns = rhs_nd if rhs_stype == 'default' else rhs_nd.todense()
+# One warm up run, verify correctness
+out = 

[GitHub] reminisce commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-09 Thread git
reminisce commented on a change in pull request #7226: Extending the GPU dot 
operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132054842
 
 

 ##
 File path: benchmark/python/dot.py
 ##
 @@ -0,0 +1,265 @@
+import ctypes
+
+from mxnet.test_utils import *
+import scipy.sparse as sp
+import os
+import time
+import argparse
+
+from mxnet.base import check_call, _LIB
+from util import get_data, estimate_density
+
+parser = argparse.ArgumentParser(description="Benchmark sparse operators",
+ 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--num-omp-threads', type=int, default=1, help='number of 
omp threads to set in MXNet')
+args = parser.parse_args()
+
+# some data information
+kdda = {
+'data_mini': 'kdda.t.mini',
+'data_name': 'kdda.t',
+'data_origin_name': 'kdda.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/kdda.t.bz2;,
+'feature_dim': 20216830,
+'m': 200,
+'batch_size': [64]
+}
+
+avazu = {
+'data_mini': 'avazu-app.t.mini',
+'data_name': 'avazu-app.t',
+'data_origin_name': 'avazu-app.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/avazu-app.t.bz2;,
+'feature_dim': 100,
+'m': 500,
+'batch_size': [64, 128]
+}
+
+
+def measure_cost(wait, repeat, f, *args, **kwargs):
+start = time.time()
+if wait:
+for i in range(repeat):
+(f(*args, **kwargs)).wait_to_read()
+else:
+for i in range(repeat):
+f(*args, **kwargs)
+end = time.time()
+diff = end - start
+return diff / repeat
+
+
+def test_dot_real(data_dict):
+def get_iter(path, data_shape, batch_size):
+data_train = mx.io.LibSVMIter(data_libsvm=path,
+  data_shape=data_shape,
+  batch_size=batch_size)
+data_iter = iter(data_train)
+return data_iter
+
+data_dir = os.path.join(os.getcwd(), 'data')
+
+path = os.path.join(data_dir, data_dict['data_name'])
+if not os.path.exists(path):
+get_data(
+data_dir,
+data_dict['data_name'],
+data_dict['url'],
+data_dict['data_origin_name']
+)
+assert os.path.exists(path)
+
+k = data_dict['feature_dim']
+m = data_dict['m']
+density = estimate_density(path, data_dict['feature_dim'])
+
+mini_path = os.path.join(data_dir, data_dict['data_mini'])
+if not os.path.exists(mini_path):
+os.system("head -n 2000 %r > %r" % (path, mini_path))
+assert os.path.exists(mini_path)
+
+print "Running Benchmarking on %r data" % data_dict['data_mini']
+for batch_size in data_dict['batch_size']:  # iterator through different 
batch size of choice
+print "batch_size is %d" % batch_size
+# model
+data_shape = (k, )
+train_iter = get_iter(mini_path, data_shape, batch_size)
+weight = mx.nd.random_uniform(low=0, high=1, shape=(k, m))
+
+csr_data = []
+dns_data = []
+num_batch = 0
+for batch in train_iter:
+data = train_iter.getdata()
+csr_data.append(data)
+dns_data.append(data.todense())
+num_batch += 1
+bag_of_data = [csr_data, dns_data]
+num_repeat = 5
+costs = []
+for d in bag_of_data:
+weight.wait_to_read()
+cost = 0.
+count = 0
+for d_batch in d:
+d_batch.wait_to_read()
+cost += measure_cost(True, num_repeat, mx.nd.dot, d_batch, 
weight)
+count += 1
+costs.append(cost/count)
+t_sparse = costs[0]
+t_dense = costs[1]
+ratio = t_dense / t_sparse
+print('density(%)\tn\tm\tk\tt_dense/t_sparse\tt_dense\tt_sparse')
+fmt = "%0.4f\t\t%d\t%d\t%d\t%0.2f\t\t\t%0.4f\t%0.6f"
+print(fmt % (density * 100, batch_size, m, k, ratio, t_dense, 
t_sparse))
+
+
+def test_dot_synthetic():
+"""benchmark sparse mxnet dot and scipy dot operator with matrices of 
given density.
+`t_sparse` is the runtime of the invoked sparse dot operator in ms, while 
`t_dense` is the 
+runtime of dot(dns, dns), with the same matrices except that they are in 
default storage type.
+"""
+# Benchmark MXNet's sparse dot operator
+def bench_mx_dot(lhs_shape, rhs_shape, lhs_stype, rhs_stype, lhs_den, 
rhs_den, trans_lhs, ctx, repeat):
+set_default_context(ctx)
+# Create matrix instances
+lhs_nd = rand_ndarray(lhs_shape, lhs_stype, density=lhs_den)
+rhs_nd = rand_ndarray(rhs_shape, rhs_stype, density=rhs_den)
+lhs_dns = lhs_nd if lhs_stype == 'default' else lhs_nd.todense()
+rhs_dns = rhs_nd if rhs_stype == 'default' else rhs_nd.todense()
+# One warm up run, verify correctness
+out = 

[GitHub] reminisce commented on a change in pull request #7226: Extending the GPU dot operator

2017-08-09 Thread git
reminisce commented on a change in pull request #7226: Extending the GPU dot 
operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132052984
 
 

 ##
 File path: benchmark/python/dot.py
 ##
 @@ -0,0 +1,265 @@
+import ctypes
+
+from mxnet.test_utils import *
+import scipy.sparse as sp
+import os
+import time
+import argparse
+
+from mxnet.base import check_call, _LIB
+from util import get_data, estimate_density
+
+parser = argparse.ArgumentParser(description="Benchmark sparse operators",
+ 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--num-omp-threads', type=int, default=1, help='number of 
omp threads to set in MXNet')
+args = parser.parse_args()
+
+# some data information
+kdda = {
+'data_mini': 'kdda.t.mini',
+'data_name': 'kdda.t',
+'data_origin_name': 'kdda.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/kdda.t.bz2;,
+'feature_dim': 20216830,
+'m': 200,
+'batch_size': [64]
+}
+
+avazu = {
+'data_mini': 'avazu-app.t.mini',
+'data_name': 'avazu-app.t',
+'data_origin_name': 'avazu-app.t.bz2',
+'url': 
"https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/avazu-app.t.bz2;,
+'feature_dim': 100,
+'m': 500,
+'batch_size': [64, 128]
+}
+
+
+def measure_cost(wait, repeat, f, *args, **kwargs):
 
 Review comment:
   I got the point of adding `wait` as an argument here from reading the code 
below. Could you add a comment explaining that `wait=True` is for mxnet 
benchmark and `False` for scipy?
 

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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] crazy-cat commented on a change in pull request #7393: add depthwise convolution's gpu version optimization

2017-08-09 Thread git
crazy-cat commented on a change in pull request #7393: add depthwise 
convolution's gpu version optimization
URL: https://github.com/apache/incubator-mxnet/pull/7393#discussion_r132099020
 
 

 ##
 File path: tests/python/unittest/test_operator.py
 ##
 @@ -955,6 +955,40 @@ def test_convolution_grouping():
 for arr1, arr2 in zip(exe1.outputs + exe1.grad_arrays, exe2.outputs + 
exe2.grad_arrays):
 np.testing.assert_allclose(arr1.asnumpy(), arr2.asnumpy(), rtol=1e-3, 
atol=1e-4)
 
+def test_depthwise_convolution():
 
 Review comment:
   OK
 

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:
us...@infra.apache.org


With regards,
Apache Git Services