[GitHub] eric-haibin-lin commented on a change in pull request #8000: Docs changes for launch.py usage

2018-01-03 Thread GitBox
eric-haibin-lin commented on a change in pull request #8000: Docs changes for 
launch.py usage
URL: https://github.com/apache/incubator-mxnet/pull/8000#discussion_r159595515
 
 

 ##
 File path: docs/faq/multi_devices.md
 ##
 @@ -148,6 +148,14 @@ Note that here we
 - `-n` number of worker nodes to run on
 - `-H` the host file which is required by `ssh` and `mpi`
 - `--kv-store` use either `dist_sync` or `dist_async`
+- `-s` number of server nodes to run on
+- If the `-s` argument is not passed, it will keep the number of servers same 
as number of workers
+- The launch.py script tries to cycle through the hosts file to launch the 
servers and workers. For example,
+  let's say you have `5` hosts in the hosts file and you passed n as `3`(and 
nothing for s).
+  The script will launch a total of `3` server processes, one each for the 
first three hosts and
+  launch a total of `3` worker processes, one each for the fourth, fifth and 
first host.
+- If the hosts file has exactly `n` number of worker nodes which is passed as 
an argument with `-n`, it will launch
+  a server and worker process on each of the `n` hosts.
 
 Review comment:
   a server process and a worker process


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] SSSSQD commented on issue #8180: Add wide and deep model into sparse example

2018-01-03 Thread GitBox
QD commented on issue #8180: Add wide and deep model into sparse example
URL: https://github.com/apache/incubator-mxnet/pull/8180#issuecomment-355217298
 
 
   hi, wide & deep learning, model.py line 52 and line 54, the hideen should be 
hidden


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] edmBernard commented on issue #1302: Draw Validation Curves

2018-01-03 Thread GitBox
edmBernard commented on issue #1302: Draw Validation Curves
URL: 
https://github.com/apache/incubator-mxnet/issues/1302#issuecomment-355215608
 
 
   @jrosebr1 here a complete example (not mine) to log accuracy and gradient in 
tensorboard from mxnet and using Gluon. 
https://gist.github.com/skirdey/8b9bd6cc20e958bc57e76004410f17ff 


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 closed pull request #9299: Updating the PyPi package URL to be Apache and not DMLC

2018-01-03 Thread GitBox
szha closed pull request #9299: Updating the PyPi package URL to be Apache and 
not DMLC
URL: https://github.com/apache/incubator-mxnet/pull/9299
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/python/setup.py b/python/setup.py
index b7a8449aaf..cf94adf982 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -104,6 +104,6 @@ def config_cython():
   description=open(os.path.join(CURRENT_DIR, 'README.md')).read(),
   packages=find_packages(),
   data_files=[('mxnet', [LIB_PATH[0]])],
-  url='https://github.com/dmlc/mxnet',
+  url='https://github.com/apache/incubator-mxnet',
   ext_modules=config_cython(),
   **kwargs)


 


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] DabiaoMa opened a new issue #9302: nd.contrib.fft issue

2018-01-03 Thread GitBox
DabiaoMa opened a new issue #9302: nd.contrib.fft issue
URL: https://github.com/apache/incubator-mxnet/issues/9302
 
 
   Hi,
   
   I am currently using nd.contrib.fft to compute STFT(short time Fourier 
transform) of audio wavs to implement the distilled WaveNet. 
   I noticed that even I set the weight of STFT loss to 0 (0 * STFT_loss), 
there are still gradients backward from STFT_loss to parameters, and this 
behavior causes the gradient to be NaN if the weight is not 0 (1 * STFT_loss)
   I have triple checked my implemented and this is the only possible place 
that may raise an error.
   
   Best,
   


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] formath commented on issue #8168: A Todo List for the Sparse Feature (CPU)

2018-01-03 Thread GitBox
formath commented on issue #8168: A Todo List for the Sparse Feature (CPU)
URL: 
https://github.com/apache/incubator-mxnet/issues/8168#issuecomment-350619183
 
 
   Please add `LibFMIter` and example `field aware factorization machine` into 
todo list


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] lightingghost closed issue #9258: How to define a variable that is not trainable?

2018-01-03 Thread GitBox
lightingghost closed issue #9258: How to define a variable that is not 
trainable?
URL: https://github.com/apache/incubator-mxnet/issues/9258
 
 
   


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] lightingghost commented on issue #9258: How to define a variable that is not trainable?

2018-01-03 Thread GitBox
lightingghost commented on issue #9258: How to define a variable that is not 
trainable?
URL: 
https://github.com/apache/incubator-mxnet/issues/9258#issuecomment-355201843
 
 
   Thanks for helping! @mwbyeon


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] anirudh2290 commented on issue #8000: Docs changes for launch.py usage

2018-01-03 Thread GitBox
anirudh2290 commented on issue #8000: Docs changes for launch.py usage
URL: https://github.com/apache/incubator-mxnet/pull/8000#issuecomment-355198690
 
 
   @piiswrong @eric-haibin-lin  is this good to merge ?


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] mwbyeon commented on issue #9258: How to define a variable that is not trainable?

2018-01-03 Thread GitBox
mwbyeon commented on issue #9258: How to define a variable that is not 
trainable?
URL: 
https://github.com/apache/incubator-mxnet/issues/9258#issuecomment-355195371
 
 
   You can use `fixed_param_names` paramter
   See 
https://mxnet.incubator.apache.org/api/python/module/module.html?highlight=fixed_param_names#mxnet.module.Module
   
   And an example.
   
https://github.com/apache/incubator-mxnet/blob/b2ce81218b13c3140dc3d2fd9fa27a1dd0264b75/example/ssd/train/train_net.py#L200-L240
   


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: Add clarification in sparse api doc (#9282)

2018-01-03 Thread zhasheng
This is an automated email from the ASF dual-hosted git repository.

zhasheng 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 546b73a  Add clarification in sparse api doc (#9282)
546b73a is described below

commit 546b73accf1b11cb8c1d0d9f5580a7d10dc83b33
Author: Haibin Lin 
AuthorDate: Wed Jan 3 19:46:27 2018 -0800

Add clarification in sparse api doc (#9282)

* Update sparse.md

* Update sparse.md
---
 docs/api/python/ndarray/sparse.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/docs/api/python/ndarray/sparse.md 
b/docs/api/python/ndarray/sparse.md
index dd0286d..3e6021e 100644
--- a/docs/api/python/ndarray/sparse.md
+++ b/docs/api/python/ndarray/sparse.md
@@ -61,9 +61,10 @@ A detailed tutorial is available at
 [RowSparseNDArray - NDArray for Sparse Gradient 
Updates](https://mxnet.incubator.apache.org/versions/master/tutorials/sparse/row_sparse.html).
 
 
-
 ```eval_rst
 
+.. note:: ``mxnet.ndarray.sparse.RowSparseNDArray`` and 
``mxnet.ndarray.sparse.CSRNDArray`` DO NOT support the ``mxnet.gluon`` 
high-level interface yet.
+
 .. note:: ``mxnet.ndarray.sparse`` is similar to ``mxnet.ndarray`` in some 
aspects. But the differences are not negligible. For instance:
 
- Only a subset of operators in ``mxnet.ndarray`` have specialized 
implementations in ``mxnet.ndarray.sparse``.

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


[GitHub] szha closed pull request #9282: Add clarification in sparse api doc

2018-01-03 Thread GitBox
szha closed pull request #9282: Add clarification in sparse api doc
URL: https://github.com/apache/incubator-mxnet/pull/9282
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/api/python/ndarray/sparse.md 
b/docs/api/python/ndarray/sparse.md
index dd0286d092..3e6021e3a3 100644
--- a/docs/api/python/ndarray/sparse.md
+++ b/docs/api/python/ndarray/sparse.md
@@ -61,9 +61,10 @@ A detailed tutorial is available at
 [RowSparseNDArray - NDArray for Sparse Gradient 
Updates](https://mxnet.incubator.apache.org/versions/master/tutorials/sparse/row_sparse.html).
 
 
-
 ```eval_rst
 
+.. note:: ``mxnet.ndarray.sparse.RowSparseNDArray`` and 
``mxnet.ndarray.sparse.CSRNDArray`` DO NOT support the ``mxnet.gluon`` 
high-level interface yet.
+
 .. note:: ``mxnet.ndarray.sparse`` is similar to ``mxnet.ndarray`` in some 
aspects. But the differences are not negligible. For instance:
 
- Only a subset of operators in ``mxnet.ndarray`` have specialized 
implementations in ``mxnet.ndarray.sparse``.


 


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: Add operator for dot(dns, csr) = csr (#8938)

2018-01-03 Thread haibin
This is an automated email from the ASF dual-hosted git repository.

haibin 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 8505442  Add operator for dot(dns, csr) = csr (#8938)
8505442 is described below

commit 85054429e7d8786d39153b051c24c9427dc6c084
Author: Anirudh Subramanian 
AuthorDate: Wed Jan 3 19:30:35 2018 -0800

Add operator for dot(dns, csr) = csr (#8938)

* Add operator for dot(dns, csr) = csr

* Fix whitespace

* Add comments

* Add comments and fix error message

* Fixes for dot dns csr

* Fixes

* Remove non required statements

* Add fallback for GPU

* Remove unused if

* Fix comments and casting

* Add operator to the documentation
---
 benchmark/python/sparse/dot.py|  51 +--
 include/mxnet/ndarray.h   |   5 +-
 src/operator/tensor/dot-inl.h | 201 --
 src/operator/tensor/dot.cc|   1 +
 tests/python/unittest/test_sparse_operator.py |  27 
 5 files changed, 260 insertions(+), 25 deletions(-)

diff --git a/benchmark/python/sparse/dot.py b/benchmark/python/sparse/dot.py
index 164e50a..5cfd540 100644
--- a/benchmark/python/sparse/dot.py
+++ b/benchmark/python/sparse/dot.py
@@ -275,7 +275,10 @@ def test_dot_synthetic(data_dict):
 # Create matrix instances
 lhs_nd = rand_ndarray(lhs_shape, lhs_stype, density=lhs_den, 
distribution=distribution)
 # only uniform distribution supported for rhs
-rhs_nd = rand_ndarray(rhs_shape, rhs_stype, density=rhs_den, 
distribution="uniform")
+if rhs_stype == 'csr':
+rhs_nd = rand_ndarray(rhs_shape, rhs_stype, density=rhs_den, 
distribution=distribution)
+else:
+rhs_nd = rand_ndarray(rhs_shape, rhs_stype, density=rhs_den, 
distribution="uniform")
 lhs_dns = None
 rhs_dns = None
 dense_cost = None
@@ -337,27 +340,41 @@ def test_dot_synthetic(data_dict):
 
 def run_benchmark(ctx=None, lhs="csr", lhs_trans=False, rhs="dns", 
fw="mxnet", rhs_density=1,
   distribution="uniform"):
-if lhs != "csr":
-raise ValueError("Value other than csr for lhs not supported")
+
 if rhs_density > 1 or rhs_density < 0:
 raise ValueError("rhs_density has to be between 0 and 1")
 
 print_benchmark_info(lhs, rhs, lhs_trans, fw)
 
+if rhs == "csr":
+lhs_stype = "default"
+rhs_stype = "csr"
+assert (lhs_stype == 'default'), "Only dot(default, csr) supported"
+# Arrange dimensions according to use case. For below csr will 
have num_rows << num_cols
+feature_dim_list = data_dict['batch_size']
+batch_size_list = data_dict['m']
+output_dim_list = data_dict['feature_dim']
+density_list = data_dict['density']
+default_output_index = data_dict['default_index']['feature_dim']
+default_density_index = data_dict['default_index']['density']
+default_feature_index = data_dict['default_index']['batch_size']
+default_batch_size_index = data_dict['default_index']['output_dim']
+num_repeat = data_dict['num_repeat']
 
-lhs_stype = "csr"
-rhs_stype = "row_sparse" if rhs == "rsp" else "default"
+else:
+lhs_stype = "csr"
+rhs_stype = "row_sparse" if rhs == "rsp" else "default"
 
-feature_dim_list = data_dict['feature_dim']
-output_dim_list = data_dict['m']
-batch_size_list = data_dict['batch_size']
-density_list = data_dict['density']
+feature_dim_list = data_dict['feature_dim']
+output_dim_list = data_dict['m']
+batch_size_list = data_dict['batch_size']
+density_list = data_dict['density']
 
-default_output_index = data_dict['default_index']['output_dim']
-default_batch_size_index = data_dict['default_index']['batch_size']
-default_feature_index = data_dict['default_index']['feature_dim']
-default_density_index = data_dict['default_index']['density']
-num_repeat = data_dict['num_repeat']
+default_output_index = data_dict['default_index']['output_dim']
+default_batch_size_index = data_dict['default_index']['batch_size']
+default_feature_index = data_dict['default_index']['feature_dim']
+default_density_index = data_dict['default_index']['density']
+num_repeat = data_dict['num_repeat']
 
 for output_dim in output_dim_list:
 if lhs_trans:
@@ -403,7 +420,7 @@ def test_dot_synthetic(data_dict):
feature_dim_list[default_feature_index]),
   

[GitHub] eric-haibin-lin closed pull request #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
eric-haibin-lin closed pull request #8938: Add operator for dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/benchmark/python/sparse/dot.py b/benchmark/python/sparse/dot.py
index 164e50aef0..5cfd540c04 100644
--- a/benchmark/python/sparse/dot.py
+++ b/benchmark/python/sparse/dot.py
@@ -275,7 +275,10 @@ def bench_dot(lhs_shape, rhs_shape, lhs_stype, rhs_stype,
 # Create matrix instances
 lhs_nd = rand_ndarray(lhs_shape, lhs_stype, density=lhs_den, 
distribution=distribution)
 # only uniform distribution supported for rhs
-rhs_nd = rand_ndarray(rhs_shape, rhs_stype, density=rhs_den, 
distribution="uniform")
+if rhs_stype == 'csr':
+rhs_nd = rand_ndarray(rhs_shape, rhs_stype, density=rhs_den, 
distribution=distribution)
+else:
+rhs_nd = rand_ndarray(rhs_shape, rhs_stype, density=rhs_den, 
distribution="uniform")
 lhs_dns = None
 rhs_dns = None
 dense_cost = None
@@ -337,27 +340,41 @@ def print_benchmark_info(lhs, rhs, lhs_trans, fw):
 
 def run_benchmark(ctx=None, lhs="csr", lhs_trans=False, rhs="dns", 
fw="mxnet", rhs_density=1,
   distribution="uniform"):
-if lhs != "csr":
-raise ValueError("Value other than csr for lhs not supported")
+
 if rhs_density > 1 or rhs_density < 0:
 raise ValueError("rhs_density has to be between 0 and 1")
 
 print_benchmark_info(lhs, rhs, lhs_trans, fw)
 
+if rhs == "csr":
+lhs_stype = "default"
+rhs_stype = "csr"
+assert (lhs_stype == 'default'), "Only dot(default, csr) supported"
+# Arrange dimensions according to use case. For below csr will 
have num_rows << num_cols
+feature_dim_list = data_dict['batch_size']
+batch_size_list = data_dict['m']
+output_dim_list = data_dict['feature_dim']
+density_list = data_dict['density']
+default_output_index = data_dict['default_index']['feature_dim']
+default_density_index = data_dict['default_index']['density']
+default_feature_index = data_dict['default_index']['batch_size']
+default_batch_size_index = data_dict['default_index']['output_dim']
+num_repeat = data_dict['num_repeat']
 
-lhs_stype = "csr"
-rhs_stype = "row_sparse" if rhs == "rsp" else "default"
+else:
+lhs_stype = "csr"
+rhs_stype = "row_sparse" if rhs == "rsp" else "default"
 
-feature_dim_list = data_dict['feature_dim']
-output_dim_list = data_dict['m']
-batch_size_list = data_dict['batch_size']
-density_list = data_dict['density']
+feature_dim_list = data_dict['feature_dim']
+output_dim_list = data_dict['m']
+batch_size_list = data_dict['batch_size']
+density_list = data_dict['density']
 
-default_output_index = data_dict['default_index']['output_dim']
-default_batch_size_index = data_dict['default_index']['batch_size']
-default_feature_index = data_dict['default_index']['feature_dim']
-default_density_index = data_dict['default_index']['density']
-num_repeat = data_dict['num_repeat']
+default_output_index = data_dict['default_index']['output_dim']
+default_batch_size_index = data_dict['default_index']['batch_size']
+default_feature_index = data_dict['default_index']['feature_dim']
+default_density_index = data_dict['default_index']['density']
+num_repeat = data_dict['num_repeat']
 
 for output_dim in output_dim_list:
 if lhs_trans:
@@ -403,7 +420,7 @@ def run_benchmark(ctx=None, lhs="csr", lhs_trans=False, 
rhs="dns", fw="mxnet", r
feature_dim_list[default_feature_index]),
   (output_row_dim,
output_dim_list[default_output_index]),
-  lhs_stype, rhs_stype, density, rhs_density, lhs_trans, 
ctx,
+  lhs_stype, rhs_stype, density, density, lhs_trans, ctx,
   num_repeat=num_repeat, fw=fw, distribution=distribution)
 
 check_call(_LIB.MXSetNumOMPThreads(ctypes.c_int(ARGS.num_omp_threads)))
@@ -423,6 +440,10 @@ def run_benchmark(ctx=None, lhs="csr", lhs_trans=False, 
rhs="dns", fw="mxnet", r
   rhs="rsp", lhs_trans=False,
   fw="mxnet", rhs_density=0.05,
   distribution=distribution)
+run_benchmark(context, lhs="default",
+  rhs="csr", lhs_trans=False,
+  

[GitHub] cjolivier01 commented on issue #9300: bugfix for parallel rand generator on multi-gpu

2018-01-03 Thread GitBox
cjolivier01 commented on issue #9300: bugfix for parallel rand generator on 
multi-gpu
URL: https://github.com/apache/incubator-mxnet/pull/9300#issuecomment-355190854
 
 
   Fix verified


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] feevos commented on issue #9288: Get HybridBlock layer shape on runtime

2018-01-03 Thread GitBox
feevos commented on issue #9288: Get HybridBlock layer shape on runtime
URL: 
https://github.com/apache/incubator-mxnet/issues/9288#issuecomment-355186696
 
 
   Hi @lupesko , thank you very much for your reply. Perhaps this is something 
I am not understanding very well (the way to properly use hybridize call in a 
unified way both with Symbol and NDArray). I've just started learning Gluon + 
mxnet. 
   
   Your solution works (I actually have this solution to my code) when the 
```_input``` variable is an NDArray type. But then I want a unified way of 
finding the shape at runtime both if I feed in an NDArray or a Symbol. As I 
understand it, the whole point of HybridBlock is to be able to use it both with 
Symbol and NDArray (and it's the former I have trouble with). 
   
   This modification of your example: 
   
   ```Python
   xx = nd.random_uniform(shape=[5,5,16,16])
   mynet = runtime_shape()
   
   mynet.hybridize() # This is the modification line
   
   mynet.hybrid_forward(nd,xx)
   ```
   
   Results the following error: 
   
   ```Python
   ---
   AttributeErrorTraceback (most recent call last)
in ()
   > 1 temp = mynet(xx)
   
   /home/dia021/anaconda2/lib/python2.7/site-packages/mxnet/gluon/block.pyc in 
__call__(self, *args)
   302 def __call__(self, *args):
   303 """Calls forward. Only accepts positional arguments."""
   --> 304 return self.forward(*args)
   305 
   306 def forward(self, *args):
   
   /home/dia021/anaconda2/lib/python2.7/site-packages/mxnet/gluon/block.pyc in 
forward(self, x, *args)
   504 try:
   505 if self._active:
   --> 506 return self._call_cached_op(x, *args)
   507 params = {i: j.data(ctx) for i, j in 
self._reg_params.items()}
   508 except DeferredInitializationError:
   
   /home/dia021/anaconda2/lib/python2.7/site-packages/mxnet/gluon/block.pyc in 
_call_cached_op(self, *args)
   412 def _call_cached_op(self, *args):
   413 if self._cached_op is None:
   --> 414 self._build_cache(*args)
   415 
   416 args, fmt = _flatten(args)
   
   /home/dia021/anaconda2/lib/python2.7/site-packages/mxnet/gluon/block.pyc in 
_build_cache(self, *args)
   377 
   378 def _build_cache(self, *args):
   --> 379 inputs, out = self._get_graph(*args)
   380 input_idx = {var.name: i for i, var in enumerate(inputs)}
   381 self._cached_op = ndarray.CachedOp(out)
   
   /home/dia021/anaconda2/lib/python2.7/site-packages/mxnet/gluon/block.pyc in 
_get_graph(self, *args)
   369 params = {i: j.var() for i, j in 
self._reg_params.items()}
   370 with self.name_scope():
   --> 371 out = self.hybrid_forward(symbol, *grouped_inputs, 
**params)  # pylint: disable=no-value-for-parameter
   372 out, self._out_format = _flatten(out)
   373 
   
in hybrid_forward(self, F, _input)
 9 
10 def hybrid_forward(self,F,_input):
   ---> 11 print('input shape: {}'.format(_input.shape))
12 return _input
13 
   
   AttributeError: 'Symbol' object has no attribute 'shape'
   ```
   
   
   Another example of the same error can be seen in this Gluon example (from 
[here](http://gluon.mxnet.io/chapter07_distributed-learning/hybridize.html?highlight=hybridize))
   
   ```Python
   import mxnet as mx
   import mxnet.ndarray as nd
   
   from mxnet import gluon
   
   class Net(gluon.HybridBlock):
   def __init__(self, **kwargs):
   super(Net, self).__init__(**kwargs)
   with self.name_scope():
   self.fc1 = gluon.nn.Dense(256)
   self.fc2 = gluon.nn.Dense(128)
   self.fc3 = gluon.nn.Dense(2)
   
   def hybrid_forward(self, F, x):
   # F is a function space that depends on the type of x
   # If x's type is NDArray, then F will be mxnet.nd
   # If x's type is Symbol, then F will be mxnet.sym
   print('type(x): {}, F: {}'.format(
   type(x).__name__, F.__name__))
   
   # 
--
   # This is the line that I added, to infer the shape, based on your 
proposal
   print('input shape: {}'.format(x.shape)) 
   # 
--
   x = F.relu(self.fc1(x))
   x = F.relu(self.fc2(x))
   return self.fc3(x)
   
   
   # First run with NDArray works:
   net = Net()
   net.collect_params().initialize()
   x = nd.random_normal(shape=(1, 512))
   print('=== 1st forward ===')
   y = net(x)
   print('=== 2nd forward ===')
   y = 

[GitHub] gamenn commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
gamenn commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355189033
 
 
   What exactly are the path variable names MXNet looks for? 


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] cjolivier01 commented on a change in pull request #9200: Fix the gradient of gather_nd

2018-01-03 Thread GitBox
cjolivier01 commented on a change in pull request #9200: Fix the gradient of 
gather_nd
URL: https://github.com/apache/incubator-mxnet/pull/9200#discussion_r159573653
 
 

 ##
 File path: src/common/cuda_utils.h
 ##
 @@ -479,6 +479,11 @@ static inline __device__ void 
atomicAdd(mshadow::half::half_t *address,
   } while (assumed != old);
 }
 
+// Overload atomicAdd to work for signed int64 on all architectures
+static inline  __device__  void atomicAdd(int64_t *address, int64_t val) {
+  atomicAdd(reinterpret_cast(address), 
static_cast(val)); // NOLINT
 
 Review comment:
   I found this: 
https://devtalk.nvidia.com/default/topic/506105/atomicadd-with-signed-long-long-not-working/


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] feevos commented on issue #9288: Get HybridBlock layer shape on runtime

2018-01-03 Thread GitBox
feevos commented on issue #9288: Get HybridBlock layer shape on runtime
URL: 
https://github.com/apache/incubator-mxnet/issues/9288#issuecomment-355186696
 
 
   Hi @lupesko , thank you very much for your reply. Perhaps this is something 
I am not understanding very well (the way to properly use hybridize call in a 
unified way both with Symbol and NDArray). I've just started learning Gluon + 
mxnet. 
   
   Your solution works (I actually have this solution to my code) when the 
```_input``` variable is an NDArray type. But then I want a unified way of 
finding the shape at runtime both if I feed in an NDArray or a Symbol. As I 
understand it, the whole point of HybridBlock is to be able to use it both with 
Symbol and NDArray (and it's the former I have trouble with). 
   
   This modification of your example: 
   
   ```Python
   xx = nd.random_uniform(shape=[5,5,16,16])
   mynet = runtime_shape()
   
   mynet.hybridize() # This is the modification line
   
   mynet.hybrid_forward(nd,xx)
   ```
   
   Results the following error: 
   
   ```Python
   ---
   AttributeErrorTraceback (most recent call last)
in ()
   > 1 temp = mynet(xx)
   
   /home/dia021/anaconda2/lib/python2.7/site-packages/mxnet/gluon/block.pyc in 
__call__(self, *args)
   302 def __call__(self, *args):
   303 """Calls forward. Only accepts positional arguments."""
   --> 304 return self.forward(*args)
   305 
   306 def forward(self, *args):
   
   /home/dia021/anaconda2/lib/python2.7/site-packages/mxnet/gluon/block.pyc in 
forward(self, x, *args)
   504 try:
   505 if self._active:
   --> 506 return self._call_cached_op(x, *args)
   507 params = {i: j.data(ctx) for i, j in 
self._reg_params.items()}
   508 except DeferredInitializationError:
   
   /home/dia021/anaconda2/lib/python2.7/site-packages/mxnet/gluon/block.pyc in 
_call_cached_op(self, *args)
   412 def _call_cached_op(self, *args):
   413 if self._cached_op is None:
   --> 414 self._build_cache(*args)
   415 
   416 args, fmt = _flatten(args)
   
   /home/dia021/anaconda2/lib/python2.7/site-packages/mxnet/gluon/block.pyc in 
_build_cache(self, *args)
   377 
   378 def _build_cache(self, *args):
   --> 379 inputs, out = self._get_graph(*args)
   380 input_idx = {var.name: i for i, var in enumerate(inputs)}
   381 self._cached_op = ndarray.CachedOp(out)
   
   /home/dia021/anaconda2/lib/python2.7/site-packages/mxnet/gluon/block.pyc in 
_get_graph(self, *args)
   369 params = {i: j.var() for i, j in 
self._reg_params.items()}
   370 with self.name_scope():
   --> 371 out = self.hybrid_forward(symbol, *grouped_inputs, 
**params)  # pylint: disable=no-value-for-parameter
   372 out, self._out_format = _flatten(out)
   373 
   
in hybrid_forward(self, F, _input)
 9 
10 def hybrid_forward(self,F,_input):
   ---> 11 print('input shape: {}'.format(_input.shape))
12 return _input
13 
   
   AttributeError: 'Symbol' object has no attribute 'shape'
   ```
   
   
   Another example of the same error can be seen in this Gluon example (from 
[here](http://gluon.mxnet.io/chapter07_distributed-learning/hybridize.html?highlight=hybridize))
   
   ```Python
   import mxnet as mx
   import mxnet.ndarray as nd
   
   from mxnet import gluon
   
   class Net(gluon.HybridBlock):
   def __init__(self, **kwargs):
   super(Net, self).__init__(**kwargs)
   with self.name_scope():
   self.fc1 = gluon.nn.Dense(256)
   self.fc2 = gluon.nn.Dense(128)
   self.fc3 = gluon.nn.Dense(2)
   
   def hybrid_forward(self, F, x):
   # F is a function space that depends on the type of x
   # If x's type is NDArray, then F will be mxnet.nd
   # If x's type is Symbol, then F will be mxnet.sym
   print('type(x): {}, F: {}'.format(
   type(x).__name__, F.__name__))
   
   # 
--
   # This is the line that I added, to infer the shape, based on your 
proposal
   print('input shape: {}'.format(x.shape)) 
   # 
--
   x = F.relu(self.fc1(x))
   x = F.relu(self.fc2(x))
   return self.fc3(x)
   
   
   # First run with NDArray works:
   net = Net()
   net.collect_params().initialize()
   x = nd.random_normal(shape=(1, 512))
   print('=== 1st forward ===')
   y = net(x)
   print('=== 2nd forward ===')
   y = 

[GitHub] zhreshold commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
zhreshold commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355185001
 
 
   @gamenn you are missing dll in path. CUDA runtime, visual c++ or something. 
windows won?t tell you which one is missing.


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 #9301: How to fine-tune VGG16

2018-01-03 Thread GitBox
szha commented on issue #9301: How to fine-tune VGG16
URL: 
https://github.com/apache/incubator-mxnet/issues/9301#issuecomment-355184393
 
 
   This has already been updated in latest version of mxnet:
   
https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/gluon/model_zoo/vision/vgg.py#L52-L63
   
   Would you be able to upgrade to the latest version of 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] mongoose54 opened a new issue #9301: How to fine-tune VGG16

2018-01-03 Thread GitBox
mongoose54 opened a new issue #9301: How to fine-tune VGG16
URL: https://github.com/apache/incubator-mxnet/issues/9301
 
 
   This is more of a general question
   
   I have pretained VGG16 `vgg = 
gluon.model_zoo.vision.vgg16_bn(pretrained=True)` . How can I replace the last 
layer (i.e. 1000 outputs) with a layer with 10 outputs? I was reading through 
the Fine Tuning tutorial 
[here](http://gluon.mxnet.io/chapter08_computer-vision/fine-tuning.html#DeepDog-net)
 but the issue is that the features in vgg16 do not contain the dense layers at 
the end. Instead the dense layers are in the Classifier part. See description 
of vgg16 below:
   
   VGG(
 (features): HybridSequential(
   (0): Conv2D(64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (1): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (2): Activation(relu)
   (3): Conv2D(64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (4): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (5): Activation(relu)
   (6): MaxPool2D(size=(2, 2), stride=(2, 2), padding=(0, 0), 
ceil_mode=False)
   (7): Conv2D(128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (8): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (9): Activation(relu)
   (10): Conv2D(128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (11): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (12): Activation(relu)
   (13): MaxPool2D(size=(2, 2), stride=(2, 2), padding=(0, 0), 
ceil_mode=False)
   (14): Conv2D(256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (15): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (16): Activation(relu)
   (17): Conv2D(256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (18): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (19): Activation(relu)
   (20): Conv2D(256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (21): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (22): Activation(relu)
   (23): MaxPool2D(size=(2, 2), stride=(2, 2), padding=(0, 0), 
ceil_mode=False)
   (24): Conv2D(512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (25): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (26): Activation(relu)
   (27): Conv2D(512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (28): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (29): Activation(relu)
   (30): Conv2D(512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (31): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (32): Activation(relu)
   (33): MaxPool2D(size=(2, 2), stride=(2, 2), padding=(0, 0), 
ceil_mode=False)
   (34): Conv2D(512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (35): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (36): Activation(relu)
   (37): Conv2D(512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (38): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (39): Activation(relu)
   (40): Conv2D(512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
   (41): BatchNorm(fix_gamma=False, eps=1e-05, momentum=0.9, axis=1)
   (42): Activation(relu)
   (43): MaxPool2D(size=(2, 2), stride=(2, 2), padding=(0, 0), 
ceil_mode=False)
 )
 (classifier): HybridSequential(
   (0): Dense(4096, Activation(relu))
   (1): Dropout(p = 0.5)
   (2): Dense(4096, Activation(relu))
   (3): Dropout(p = 0.5)
   (4): Dense(1000, linear)
 )
   )


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] lupesko commented on issue #9288: Get HybridBlock layer shape on runtime

2018-01-03 Thread GitBox
lupesko commented on issue #9288: Get HybridBlock layer shape on runtime
URL: 
https://github.com/apache/incubator-mxnet/issues/9288#issuecomment-355182978
 
 
   @nswamy please apply labels:
   Triaged
   Pending Requester Info
   Request For Information


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] lupesko commented on issue #9288: Get HybridBlock layer shape on runtime

2018-01-03 Thread GitBox
lupesko commented on issue #9288: Get HybridBlock layer shape on runtime
URL: 
https://github.com/apache/incubator-mxnet/issues/9288#issuecomment-355182832
 
 
   Are you trying to get the input shape at runtime?
   If so, `infer_shape` is not the right API.
   
   You may want to try something like:
   ```
   import mxnet as mx
   import mxnet.ndarray as nd
   from mxnet.gluon import HybridBlock
   
   class runtime_shape(HybridBlock):
  
   def __init__(self,  **kwards):
   HybridBlock.__init__(self,**kwards)
   
   def hybrid_forward(self,F,_input):
   print('input shape: {}'.format(_input.shape))
   return _input
   
   xx = nd.random_uniform(shape=[5,5,16,16])
   mynet = runtime_shape()
   mynet.hybrid_forward(nd,xx)
   ```
   
   Which returns:
   `input shape: (5L, 5L, 16L, 16L)`


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] javelinjs commented on a change in pull request #9300: bugfix for parallel rand generator on multi-gpu

2018-01-03 Thread GitBox
javelinjs commented on a change in pull request #9300: bugfix for parallel rand 
generator on multi-gpu
URL: https://github.com/apache/incubator-mxnet/pull/9300#discussion_r159570071
 
 

 ##
 File path: src/resource.cc
 ##
 @@ -272,24 +273,24 @@ class ResourceManagerImpl : public ResourceManager {
 /*! \brief current pointer to the round roubin allocator */
 std::atomic curr_ptr;
 /*! \brief constructor */
-explicit ResourceNativeRandom(Context ctx, size_t ncopy, uint32_t 
global_seed)
+explicit ResourceParallelRandom(Context ctx, size_t ncopy, uint32_t 
global_seed)
 : ctx(ctx), sampler(ncopy), resource(ncopy), curr_ptr(0) {
   for (size_t i = 0; i < sampler.size(); ++i) {
 const uint32_t seed = ctx.dev_id + i * kMaxNumGPUs + global_seed * 
kRandMagic;
 resource[i].var = Engine::Get()->NewVariable();
 common::random::RandGenerator *r = new 
common::random::RandGenerator();
-common::random::RandGenerator::AllocState(r);
 
 Review comment:
   this is the line that caused the bug.


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] javelinjs opened a new pull request #9300: bugfix for parallel rand generator on multi-gpu

2018-01-03 Thread GitBox
javelinjs opened a new pull request #9300: bugfix for parallel rand generator 
on multi-gpu
URL: https://github.com/apache/incubator-mxnet/pull/9300
 
 
   ## Description ##
   
   GPU rand state was not allocated on the right device, which can cause 
'illegal memory access' when running with multi-GPUs.
   
   It's line 281 in `src/resource.cc` causes the problem.
   
   Can we do test on multi-gpu? I mean, can I assume our CI instances have 
multi-gpu enabled?
   
   ## Checklist ##
   ### Essentials ###
   - [x] Passed code style checking (`make lint`)
   - [x] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [x] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - [x] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ### Changes ###
   * Fix gpu rand state allocation problem
   * readability: NativeRandom -> ParallelRandom
   


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 #9292: Runing MxNet

2018-01-03 Thread GitBox
szha commented on issue #9292: Runing MxNet
URL: 
https://github.com/apache/incubator-mxnet/issues/9292#issuecomment-355177923
 
 
   @abidmalik1967 you have multiple copies of mxnet on your machine.
   The one you installed is `mxnet-cu80==0.11.0` which is likely in 
`/lfs1/software7/anaconda2/lib/python2.7/site-packages`
   The one you ran is likely `mxnet-cu75==0.9.4` which is in 
`/home/amalik/.local/lib/python2.7/site-packages/mxnet-0.9.4-py2.7.egg/mxnet/`
   
   Given that you have cuda 8.0 installed judging from your LD_LIBRARY_PATH, 
you will want to remove the second copy of mxnet and try again.


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] lupesko opened a new pull request #9299: Updating the PyPi package URL to be Apache and not DMLC

2018-01-03 Thread GitBox
lupesko opened a new pull request #9299: Updating the PyPi package URL to be 
Apache and not DMLC
URL: https://github.com/apache/incubator-mxnet/pull/9299
 
 
   ## Description ##
   Minor change to update the PyPi package URL to be Apache and not the old 
DMLC.
   
   @szha 


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] lck1201 commented on issue #9291: find a bug in mxnet.gluon.utils.clip_global_norm(arrays, max_norm)

2018-01-03 Thread GitBox
lck1201 commented on issue #9291: find a bug in 
mxnet.gluon.utils.clip_global_norm(arrays, max_norm)
URL: 
https://github.com/apache/incubator-mxnet/issues/9291#issuecomment-355176995
 
 
   @lupesko  @sxjscience  thank you guys


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] marcoabreu opened a new pull request #9298: Increase timeout for GIT on windows (Fix #9297)

2018-01-03 Thread GitBox
marcoabreu opened a new pull request #9298: Increase timeout for GIT on windows 
(Fix #9297)
URL: https://github.com/apache/incubator-mxnet/pull/9298
 
 
   This PR increases the timeout for git checkout on windows slaves to 5x15 
minutes. This will GitHub enough time to reset the quota.


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] marcoabreu opened a new issue #9297: git checkout on windows slaves times out

2018-01-03 Thread GitBox
marcoabreu opened a new issue #9297: git checkout on windows slaves times out
URL: https://github.com/apache/incubator-mxnet/issues/9297
 
 
   Due to rate limiting, introduced by GitHub, git checkout on windows slaves 
times out if multiple jobs are getting started at the same time.
   
   
http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/incubator-mxnet/detail/PR-9152-merge/2/pipeline
   


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] chaoyuaw commented on a change in pull request #9165: add embedding learning example

2018-01-03 Thread GitBox
chaoyuaw commented on a change in pull request #9165: add embedding learning 
example
URL: https://github.com/apache/incubator-mxnet/pull/9165#discussion_r159566297
 
 

 ##
 File path: example/gluon/embedding_learning/README.md
 ##
 @@ -0,0 +1,72 @@
+# Image Embedding Learning
+
+This example implements embedding learning based on a Margin-based Loss with 
distance weighted sampling [(Wu et al, 
2017)](http://www.philkr.net/papers/2017-10-01-iccv/2017-10-01-iccv.pdf). The 
model obtains a validation Recall@1 of ~64% on the [Caltech-UCSD 
Birds-200-2011](http://www.vision.caltech.edu/visipedia/CUB-200-2011.html) 
dataset.
 
 Review comment:
   Yes, approximately (slightly higher recall@1 and slightly lower recall@16 
than what's reported in the paper). The difference is < 1%.
   
   The difference between this implementation and the original implementation 
is that here we perform sampling within each GPU while the original paper 
implements cross-gpu sampling. Since the performance is almost identical (at 
least on this dataset), I use per-gpu sampling here for simplicity. 


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] marcoabreu opened a new pull request #9296: Disable test_operator.test_laop_3 #9295

2018-01-03 Thread GitBox
marcoabreu opened a new pull request #9296: Disable test_operator.test_laop_3 
#9295
URL: https://github.com/apache/incubator-mxnet/pull/9296
 
 
   In order to improve stability as tracked in 
https://github.com/apache/incubator-mxnet/issues/9295, this test should be 
disabled. Also, the skip regarding CUDA 7.5 is removed as this constraint does 
not apply anymore.


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] marcoabreu opened a new issue #9295: test_operator.test_laop_3 hangs

2018-01-03 Thread GitBox
marcoabreu opened a new issue #9295: test_operator.test_laop_3 hangs
URL: https://github.com/apache/incubator-mxnet/issues/9295
 
 
   The execution of test_operator.test_laop_3 randomly hangs without a message 
on Python3: MKLML-CPU. See 
http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/incubator-mxnet/detail/master/130/pipeline/329
 


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] marcoabreu commented on issue #9295: test_operator.test_laop_3 hangs

2018-01-03 Thread GitBox
marcoabreu commented on issue #9295: test_operator.test_laop_3 hangs
URL: 
https://github.com/apache/incubator-mxnet/issues/9295#issuecomment-355172885
 
 
   @piiswrong @szha Please assign the proper label.


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] tornadomeet commented on a change in pull request #9290: add epoch parameter to export() of HybridBlock

2018-01-03 Thread GitBox
tornadomeet commented on a change in pull request #9290: add epoch parameter to 
export() of HybridBlock
URL: https://github.com/apache/incubator-mxnet/pull/9290#discussion_r159563554
 
 

 ##
 File path: python/mxnet/gluon/block.py
 ##
 @@ -480,8 +480,10 @@ def export(self, path):
 Parameters
 --
 path : str
-Path to save model. Two files `path-symbol.json` and 
`path-.params`
+Path to save model. Two files `path-symbol.json` and 
`path-epoch.params`
 
 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] sxjscience closed issue #9291: find a bug in mxnet.gluon.utils.clip_global_norm(arrays, max_norm)

2018-01-03 Thread GitBox
sxjscience closed issue #9291: find a bug in 
mxnet.gluon.utils.clip_global_norm(arrays, max_norm)
URL: https://github.com/apache/incubator-mxnet/issues/9291
 
 
   


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] gamenn commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
gamenn commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355169213
 
 
   @zhreshold: Pasting below the output of diagnose.py
   
   --Python Info--
   Version  : 3.6.2
   Compiler : MSC v.1900 64 bit (AMD64)
   Build: ('default', 'Sep 19 2017 08:03:39')
   Arch : ('64bit', 'WindowsPE')
   Pip Info---
   Version  : 9.0.1
   Directory: 
C:\Users\myUserName\AppData\Local\Continuum\anaconda3\lib\site-packages\pip
   --MXNet Info---
   Traceback (most recent call last):
 File "diagnose.py", line 107, in check_mxnet
   import mxnet
 File 
"C:\Users\myUserName\AppData\Local\Continuum\anaconda3\lib\site-packages\mxnet\__init__.py",
 line 25, in 
   from . import engine
 File 
"C:\Users\myUserName\AppData\Local\Continuum\anaconda3\lib\site-packages\mxnet\engine.py",
 line 23, in 
   from .base import _LIB, check_call
 File 
"C:\Users\myUserName\AppData\Local\Continuum\anaconda3\lib\site-packages\mxnet\base.py",
 line 111, in 
   _LIB = _load_lib()
 File 
"C:\Users\myUserName\AppData\Local\Continuum\anaconda3\lib\site-packages\mxnet\base.py",
 line 103, in _load_lib
   lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
 File 
"C:\Users\myUserName\AppData\Local\Continuum\anaconda3\lib\ctypes\__init__.py", 
line 348, in __init__
   self._handle = _dlopen(self._name, mode)
   OSError: [WinError 126] The specified module could not be found
   
   --System Info--
   Platform : Windows-10-10.0.15063-SP0
   system   : Windows
   node : SEA-9903526803
   release  : 10
   version  : 10.0.15063
   --Hardware Info--
   machine  : AMD64
   processor: Intel64 Family 6 Model 79 Stepping 1, GenuineIntel
   --Network Test--
   Setting timeout: 10
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0140 
sec, LOAD: 0.9081 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0108 sec, LOAD: 
0.0170 sec.
   Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0325 sec, LOAD: 
0.0380 sec.
   Timing for FashionMNIST: 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz,
 DNS: 0.0307 sec, LOAD: 0.0670 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0180 sec, LOAD: 
0.1020 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0088 sec, 
LOAD: 0.0402 sec.
   


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] anirudh2290 commented on issue #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
anirudh2290 commented on issue #8938: Add operator for dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#issuecomment-355168439
 
 
   Added dot(dns, csr) = csr to operator doc


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 issue #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
eric-haibin-lin commented on issue #8938: Add operator for dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#issuecomment-355166759
 
 
   Is the operator documentation not 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] eric-haibin-lin commented on a change in pull request #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
eric-haibin-lin commented on a change in pull request #8938: Add operator for 
dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#discussion_r159560322
 
 

 ##
 File path: src/operator/tensor/dot-inl.h
 ##
 @@ -228,8 +231,17 @@ inline bool DotForwardInferStorageType(const 
nnvm::NodeAttrs& attrs,
   if (!dispatched && lhs_stype == kCSRStorage && rhs_rsp_or_dns &&
   !param.transpose_a && !param.transpose_b) {
 // csr, rsp/dns -> dns
-dispatched = storage_type_assign(_stype, kDefaultStorage,
- dispatch_mode, DispatchMode::kFComputeEx);
+dispatched = storage_type_assign(_stype, kDefaultStorage, 
dispatch_mode,
+ DispatchMode::kFComputeEx);
+  }
+  if (!dispatched && lhs_stype == kDefaultStorage && rhs_stype == kCSRStorage 
&&
+  !param.transpose_a && !param.transpose_b) {
+// dns, csr -> csr
+const bool invalid_ctx = dev_mask != mshadow::cpu::kDevMask;
+const auto dispatch_ex = invalid_ctx ? DispatchMode::kFComputeFallback
+ : DispatchMode::kFComputeEx;
+dispatched = storage_type_assign(_stype, kCSRStorage, dispatch_mode,
+ dispatch_ex);
   }
 
 Review comment:
   Yes. We can fix that in a separate 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 issue #8143: `mx.callback.Speedometer` cannot be used in `epoch_end_callback`

2018-01-03 Thread GitBox
szha commented on issue #8143: `mx.callback.Speedometer` cannot be used in 
`epoch_end_callback`
URL: 
https://github.com/apache/incubator-mxnet/issues/8143#issuecomment-355166185
 
 
   @apache/mxnet-committers: This issue has been inactive for the past 90 days. 
It has no label and needs triage.
   
   For general "how-to" questions, our [user forum](https://discuss.mxnet.io/) 
(and [Chinese version](https://discuss.gluon.ai/)) is a good place to get help.


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] anirudh2290 commented on issue #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
anirudh2290 commented on issue #8938: Add operator for dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#issuecomment-355166255
 
 
   @eric-haibin-lin Thank you for reviewing! I have made the necessary changes.


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 #9165: add embedding learning example

2018-01-03 Thread GitBox
piiswrong commented on a change in pull request #9165: add embedding learning 
example
URL: https://github.com/apache/incubator-mxnet/pull/9165#discussion_r159559843
 
 

 ##
 File path: example/gluon/embedding_learning/README.md
 ##
 @@ -0,0 +1,72 @@
+# Image Embedding Learning
+
+This example implements embedding learning based on a Margin-based Loss with 
distance weighted sampling [(Wu et al, 
2017)](http://www.philkr.net/papers/2017-10-01-iccv/2017-10-01-iccv.pdf). The 
model obtains a validation Recall@1 of ~64% on the [Caltech-UCSD 
Birds-200-2011](http://www.vision.caltech.edu/visipedia/CUB-200-2011.html) 
dataset.
 
 Review comment:
   does performance match the original paper?


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 #9293: Make numpy functions return Symbol instead of numpy object array

2018-01-03 Thread GitBox
piiswrong closed pull request #9293: Make numpy functions return Symbol instead 
of numpy object array
URL: https://github.com/apache/incubator-mxnet/pull/9293
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/python/mxnet/symbol/symbol.py b/python/mxnet/symbol/symbol.py
index 22212b0bdb..98c7086c8e 100644
--- a/python/mxnet/symbol/symbol.py
+++ b/python/mxnet/symbol/symbol.py
@@ -56,6 +56,9 @@ class Symbol(SymbolBase):
 # pylint: disable=no-member
 __slots__ = []
 
+# Make numpy functions return Symbol instead of numpy object array
+__array_priority__ = 1000.0
+
 def __repr__(self):
 """Gets a string representation of the symbol."""
 name = self.name


 


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: Make numpy functions return Symbol instead of numpy object array (#9293)

2018-01-03 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 f79f0d4  Make numpy functions return Symbol instead of numpy object 
array (#9293)
f79f0d4 is described below

commit f79f0d441619dedef59035e049c1506887a9e288
Author: Chris Olivier 
AuthorDate: Wed Jan 3 16:22:14 2018 -0800

Make numpy functions return Symbol instead of numpy object array (#9293)

* Make numpy functions return Symbol instead of numpy object array

* Trigger rebuild
---
 python/mxnet/symbol/symbol.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/python/mxnet/symbol/symbol.py b/python/mxnet/symbol/symbol.py
index 22212b0..98c7086 100644
--- a/python/mxnet/symbol/symbol.py
+++ b/python/mxnet/symbol/symbol.py
@@ -56,6 +56,9 @@ class Symbol(SymbolBase):
 # pylint: disable=no-member
 __slots__ = []
 
+# Make numpy functions return Symbol instead of numpy object array
+__array_priority__ = 1000.0
+
 def __repr__(self):
 """Gets a string representation of the symbol."""
 name = self.name

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


[GitHub] sxjscience commented on issue #9291: find a bug in mxnet.gluon.utils.clip_global_norm(arrays, max_norm)

2018-01-03 Thread GitBox
sxjscience commented on issue #9291: find a bug in 
mxnet.gluon.utils.clip_global_norm(arrays, max_norm)
URL: 
https://github.com/apache/incubator-mxnet/issues/9291#issuecomment-355163811
 
 
   This is not a bug. `clip_global_norm` clips the gradient arrays in place and 
returns the original norm.


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 commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
zhreshold commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355163288
 
 
   @gamenn I suggest you can do quick self diagnose, for example, pip --version 
inside anaconda prompt, try to locate the site-packages of conda python, etc.
   
   Anyways, if you are still out of luck, please use the script of 
https://github.com/apache/incubator-mxnet/blob/master/tools/diagnose.py and 
paste results here.


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] lupesko commented on issue #9289: How to get the symbol type?

2018-01-03 Thread GitBox
lupesko commented on issue #9289: How to get the symbol type?
URL: 
https://github.com/apache/incubator-mxnet/issues/9289#issuecomment-355161965
 
 
   @nswamy please apply labels:
   Triaged
   Request For Information
   
   And please close.


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] gamenn commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
gamenn commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355160587
 
 
   @zhreshold: I ran "pip install mxnet-cu80==1.0.0" from within the Anaconda 
prompt. I presume that would be the right way to install; isn't it?
   
 


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] lupesko commented on issue #9289: How to get the symbol type?

2018-01-03 Thread GitBox
lupesko commented on issue #9289: How to get the symbol type?
URL: 
https://github.com/apache/incubator-mxnet/issues/9289#issuecomment-355161882
 
 
   Thank you @mwbyeon !
   @KeyKy I think we can close the issue, feel free to re-open if you still 
have questions.


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] gamenn commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
gamenn commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355161778
 
 
   @lupesko: Added Windows and Python version info to the issue above. There is 
not much of a error callstack for this issue since the very first import line 
itself is failing as unrecognized 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] lupesko commented on issue #9291: find a bug in mxnet.gluon.utils.clip_global_norm(arrays, max_norm)

2018-01-03 Thread GitBox
lupesko commented on issue #9291: find a bug in 
mxnet.gluon.utils.clip_global_norm(arrays, max_norm)
URL: 
https://github.com/apache/incubator-mxnet/issues/9291#issuecomment-355161466
 
 
   @nswamy please apply labels:
   Triaged
   Bug


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 closed issue #9176: row_sparse ndarray + 0 should not return dense ndarray

2018-01-03 Thread GitBox
eric-haibin-lin closed issue #9176: row_sparse ndarray + 0 should not return 
dense ndarray
URL: https://github.com/apache/incubator-mxnet/issues/9176
 
 
   


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] lupesko commented on issue #9291: find a bug in mxnet.gluon.utils.clip_global_norm(arrays, max_norm)

2018-01-03 Thread GitBox
lupesko commented on issue #9291: find a bug in 
mxnet.gluon.utils.clip_global_norm(arrays, max_norm)
URL: 
https://github.com/apache/incubator-mxnet/issues/9291#issuecomment-355161399
 
 
   Thank you @lck1201 !
   I think you are correct, looping in @piiswrong for guidance.
   Additionally, we should expand the docstring to be more informative.
   
   @piiswrong - can you confirm this is indeed a bug?
   @lck1201 - would you like to submit a PR with this fix?


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: sparse output for binary scalar op with zero (#9227)

2018-01-03 Thread haibin
This is an automated email from the ASF dual-hosted git repository.

haibin 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 9d51e1a  sparse output for binary scalar op with zero (#9227)
9d51e1a is described below

commit 9d51e1af3778418a65a82f8a35a4032bedc6cbe1
Author: Ziyue Huang 
AuthorDate: Thu Jan 4 07:56:18 2018 +0800

sparse output for binary scalar op with zero (#9227)

* sparse output for binary scalar op with zero

* same out stype for cpu/gpu

* update

* update

* address comments
---
 .../tensor/elemwise_binary_scalar_op_basic.cc  | 29 +++---
 tests/python/gpu/test_operator_gpu.py  |  2 +-
 tests/python/unittest/test_sparse_ndarray.py   |  8 --
 3 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/src/operator/tensor/elemwise_binary_scalar_op_basic.cc 
b/src/operator/tensor/elemwise_binary_scalar_op_basic.cc
index 9a278d8..6792379 100644
--- a/src/operator/tensor/elemwise_binary_scalar_op_basic.cc
+++ b/src/operator/tensor/elemwise_binary_scalar_op_basic.cc
@@ -47,25 +47,36 @@
 namespace mxnet {
 namespace op {
 
+/*!
+ * \brief FInferStorageType for binary operator with scalar,
+ *   csr -> csr and row_sparse -> row_sparse if the scalar is zero,
+ *   otherwise the output is of default storage.
+ */
 static bool BinaryScalarStorageTypeWithDenseResultStorageType(const NodeAttrs& 
attrs,
   const int 
dev_mask,
   DispatchMode* 
dispatch_mode,
   
std::vector* in_attrs,
   
std::vector* out_attrs)  {
+  CHECK_EQ(in_attrs->size(), 1);
+  CHECK_EQ(out_attrs->size(), 1);
   bool dispatched = false;
-  if (common::ContainsOnlyStorage(*in_attrs, kDefaultStorage)) {
+  const bool invalid_ctx = dev_mask != kCPU;
+  const NDArrayStorageType instype = 
static_cast(in_attrs->at(0));
+  const auto dispatch_ex = invalid_ctx ? DispatchMode::kFComputeFallback
+   : DispatchMode::kFComputeEx;
+  const double alpha = nnvm::get(attrs.parsed);
+  if (instype == kDefaultStorage) {
 dispatched = storage_type_assign(_attrs[0],
- kDefaultStorage,
- dispatch_mode,
- DispatchMode::kFCompute);
-  } else if (dev_mask == kCPU) {
-dispatched = storage_type_assign(_attrs[0],
- kDefaultStorage,
- dispatch_mode,
- DispatchMode::kFComputeEx);
+  kDefaultStorage, dispatch_mode, DispatchMode::kFCompute);
+  }
+  if (!dispatched && (instype == kCSRStorage || instype == kRowSparseStorage)) 
{
+dispatched = storage_type_assign(_attrs[0], alpha == 0 ? instype : 
kDefaultStorage,
+  dispatch_mode, dispatch_ex);
   }
   if (!dispatched) {
 dispatch_fallback(out_attrs, dispatch_mode);
+  }
+  if (static_cast(*dispatch_mode) == 
DispatchMode::kFComputeFallback) {
 LogStorageFallback(attrs, dev_mask, in_attrs, out_attrs);
   }
   return true;
diff --git a/tests/python/gpu/test_operator_gpu.py 
b/tests/python/gpu/test_operator_gpu.py
index 31e888b..52aca09 100644
--- a/tests/python/gpu/test_operator_gpu.py
+++ b/tests/python/gpu/test_operator_gpu.py
@@ -38,7 +38,7 @@ from test_sparse_ndarray import test_create_csr, 
test_create_row_sparse, test_sp
 from test_sparse_ndarray import test_create_sparse_nd_empty, 
test_create_sparse_nd_from_sparse
 from test_sparse_ndarray import test_create_sparse_nd_from_dense, 
test_create_sparse_nd_infer_shape
 from test_sparse_ndarray import test_sparse_nd_check_format, 
test_sparse_nd_copy
-from test_sparse_ndarray import test_sparse_nd_setitem
+from test_sparse_ndarray import test_sparse_nd_setitem, 
test_sparse_nd_binary_scalar_op
 from test_sparse_operator import *
 from test_ndarray import *
 
diff --git a/tests/python/unittest/test_sparse_ndarray.py 
b/tests/python/unittest/test_sparse_ndarray.py
index e404997..185ce7f 100644
--- a/tests/python/unittest/test_sparse_ndarray.py
+++ b/tests/python/unittest/test_sparse_ndarray.py
@@ -264,12 +264,14 @@ def test_sparse_nd_binary():
 
 def test_sparse_nd_binary_scalar_op():
 N = 3
-def check(fn, stype):
+def check(fn, stype, out_stype=None):
 for _ in range(N):
 ndim = 2
 shape = np.random.randint(1, 6, size=(ndim,))
 npy = np.random.normal(0, 1, size=shape)
 nd = mx.nd.array(npy).tostype(stype)
+if out_stype is not None:
+assert(nd.stype == out_stype)
 assert_allclose(fn(npy), 

[incubator-mxnet] branch master updated: Usability improvement mxnet vae (#9008)

2018-01-03 Thread haibin
This is an automated email from the ASF dual-hosted git repository.

haibin 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 9eff221  Usability improvement mxnet vae (#9008)
9eff221 is described below

commit 9eff2219d8261677219c3691ac00cfc6ef091bba
Author: Anirudh Subramanian 
AuthorDate: Wed Jan 3 15:55:15 2018 -0800

Usability improvement mxnet vae (#9008)

* Add code for README, convert_data and vaegan_mxnet

* Integer division for vaegan

* Remove print statements

* README changes

* README  changes for mxnet adversarial VAE
---
 example/mxnet_adversarial_vae/README.md   |  52 ++-
 example/mxnet_adversarial_vae/convert_data.py |  63 ++--
 example/mxnet_adversarial_vae/vaegan_mxnet.py | 525 +++---
 3 files changed, 300 insertions(+), 340 deletions(-)

diff --git a/example/mxnet_adversarial_vae/README.md 
b/example/mxnet_adversarial_vae/README.md
index 6eb5f74..469668b 100644
--- a/example/mxnet_adversarial_vae/README.md
+++ b/example/mxnet_adversarial_vae/README.md
@@ -1,22 +1,56 @@
-VAE-GAN in MXNet
+# VAE-GAN in MXNet
 
-Implementation of Autoencoding beyond pixels using a learned similarity metric 
based on the Tensorflow implementation of 
https://github.com/JeremyCCHsu/tf-vaegan/
+* Implementation of [Autoencoding beyond pixels using a learned similarity 
metric](https://arxiv.org/abs/1512.09300),
+  based on the Tensorflow implementation: 

 
-*Please refer to their official Github for details*: 
https://github.com/andersbll/autoencoding_beyond_pixels
+* Please refer to their official Github for details: [Autoencoding Beyond 
Pixels](https://github.com/andersbll/autoencoding_beyond_pixels)
 
-As the name indicates, VAE-GAN replaces GAN's generator with a variational 
auto-encoder, resulting in a model with both inference and generation 
components. 
+* As the name indicates, VAE-GAN replaces GAN's generator with a variational 
auto-encoder, resulting in a model with both inference and generation 
components. 
 
-Experiements
+# Experiements
 
-Dataset: caltech 101 silhouettes dataset from 
https://people.cs.umass.edu/~marlin/data.shtml
+* Dataset: caltech 101 silhouettes dataset from 

 
-Usage
+# Prerequisites
 
-Using existing models
+* Opencv
+* Python packages required: scipy, scikit-learn and Pillow, opencv python 
package
 
+# Environment Tested On
+
+Deep Learning AMI (Ubuntu) - 2.0, p2.8xlarge
+
+# Usage
+
+If you want to train and test with the default options do the following:
+
+1. Download the default dataset and convert from matlab file format to png 
file format
+```
+python convert_data.py
+```
+2. Train on the downloaded dataset and store the encoder model and generator 
model params.
+```
+python vaegan_mxnet.py --train
+```
+3. Test on the downloaded dataset
+```
+python vaegan_mxnet.py --test --testing_data_path 
/home/ubuntu/datasets/caltech101/test_data
+```
+
+* Using existing models:
+
+```
 python vaegan_mxnet.py --test --testing_data_path [your dataset image path] 
--pretrained_encoder_path [pretrained encoder model path] 
--pretrained_generator_path [pretrained generator model path] [options]
+```
 
-Train a new model
+* Train a new model:
 
+```
 python vaegan_mxnet.py --train --training_data_path [your dataset image path] 
[options]
+```
+
+* Training on the CPU:
 
+```
+python vaegan_mxnet.py --train --use_cpu --training_data_path [your dataset 
image path] [options]
+```
diff --git a/example/mxnet_adversarial_vae/convert_data.py 
b/example/mxnet_adversarial_vae/convert_data.py
index c25e8c9..093ca1c 100644
--- a/example/mxnet_adversarial_vae/convert_data.py
+++ b/example/mxnet_adversarial_vae/convert_data.py
@@ -20,33 +20,44 @@ Created on Jun 15, 2017
 
 @author: shujon
 '''
+import sys
+import os
+import logging
+import argparse
+import errno
+from PIL import Image
 import scipy.io
 import scipy.misc
 import numpy as np
-import unicodedata
-from PIL import Image
-import argparse
+from mxnet.test_utils import *
+
+logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
 
-##
-# convert the caltech101 mat file to images
-# sample run : python convert_data.py --dataset 
/home/ubuntu/datasets/caltech101/data/caltech101_silhouettes_28.mat --save_path 
/home/ubuntu/datasets/caltech101/data/ --invert --height 32 --width 32
-##
+DEFAULT_DATA_DIR = "datasets/caltech101/data"
+DEFAULT_OUTPUT_DATA_DIR = "{}/{}".format(DEFAULT_DATA_DIR, "images32x32")
+DEFAULT_MAT_FILE = "caltech101_silhouettes_28.mat"
+DEFAULT_DATASET_URL = 
"https://people.cs.umass.edu/~marlin/data/caltech101_silhouettes_28.mat;
 
 
 def convert_mat_to_images(args):
-dataset = 

[GitHub] gamenn commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
gamenn commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355160587
 
 
   @zhreshold: I ran "pip install mxnet-cu80==1.0.0" from within the Anaconda 
prompt. I presume that would the right way to install; isn't it?
   


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] lupesko commented on issue #9292: Runing MxNet

2018-01-03 Thread GitBox
lupesko commented on issue #9292: Runing MxNet
URL: 
https://github.com/apache/incubator-mxnet/issues/9292#issuecomment-355160558
 
 
   @nswamy please apply labels:
   Triaged
   Pending Requester Info


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] lupesko commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
lupesko commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355159628
 
 
   @gamenn, if @zhreshold suggestion still does not work, please provide more 
info so we can look into it:
   - Windows version
   - Python version
   - The full error stack
 


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] lupesko commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
lupesko commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355159655
 
 
   @nswamy please apply labels:
   - Triaged
   - Windows
   - Installation
   - Pending Requester Info


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] lupesko commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
lupesko commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355159628
 
 
   @gamenn can you please provide more info:
   - Windows version
   - Python version
   - The full error stack


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] lupesko commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
lupesko commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355159655
 
 
   @nswamy please apply labels:
   - Triaged
   - Windows
   - Installation


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 commented on issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
zhreshold commented on issue #9294: Trouble installing on Windows
URL: 
https://github.com/apache/incubator-mxnet/issues/9294#issuecomment-355159335
 
 
   This is most likely you are pythonmidmatched pip and python.
   Make sure you install using the pip come with anaconda


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] gamenn opened a new issue #9294: Trouble installing on Windows

2018-01-03 Thread GitBox
gamenn opened a new issue #9294: Trouble installing on Windows
URL: https://github.com/apache/incubator-mxnet/issues/9294
 
 
   [I am posting this issue for the attention of @zhreshold, as suggested by a 
member of MXNet team.
   
   I am trying to get MXNet working on Windows with Anaconda distribution of 
Python.  After running around a bit, I was told by a member of the MXNet team 
(AstonZ) that the installation command to use is:
   
   `pip install mxnet-cu80==1.0.0 `
   
   However, after doing that, "import mxnet as mx" line fails with ?The 
specified module could not be found? 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] piiswrong commented on a change in pull request #9283: Fix custom op multi-gpu scaling

2018-01-03 Thread GitBox
piiswrong commented on a change in pull request #9283: Fix custom op multi-gpu 
scaling
URL: https://github.com/apache/incubator-mxnet/pull/9283#discussion_r159549694
 
 

 ##
 File path: src/operator/custom/custom-inl.h
 ##
 @@ -63,11 +64,80 @@ class Registry {
 return nullptr;
   }
 
-  static Registry* Get();
+  template
+  void Push(const Func& func,
+const OpContext& ctx,
+bool recording,
+bool training,
+const std::vector& arrs) {
+if (naive_engine_) {
+  func();
+  ctx.async_on_complete();
+  return;
+}
+std::unique_lock lock(mutex_);
+q_.push(
+  [=]() mutable {
+bool prev_recording = Imperative::Get()->set_is_recording(recording);
+bool prev_training = Imperative::Get()->set_is_training(training);
+
+func();
+
+Imperative::Get()->set_is_training(prev_training);
+Imperative::Get()->set_is_recording(prev_recording);
+
+std::vector vars;
+for (const auto& i : arrs) vars.push_back(i.var());
+Engine::Get()->PushSync([=](RunContext rctx) {
 
 Review comment:
   That's fine. Engine is thread safe


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: Updating the README files and examples in "ctc" and "recommenders" folder. (#9073)

2018-01-03 Thread haibin
This is an automated email from the ASF dual-hosted git repository.

haibin 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 600a163  Updating the README files and examples in "ctc" and 
"recommenders" folder. (#9073)
600a163 is described below

commit 600a163a41451fe1609085bdc546476e8810d7d0
Author: Amol Lele <19983848+lelea...@users.noreply.github.com>
AuthorDate: Wed Jan 3 14:55:17 2018 -0800

Updating the README files and examples in "ctc" and "recommenders" folder. 
(#9073)

* Updating the README file with information to run the example.

* Updated the examples and README files in recommenders directory.
---
 example/ctc/README.md  | 96 +++---
 example/recommenders/README.md |  7 +++
 example/recommenders/movielens_data.py |  4 +-
 example/recommenders/negativesample.py |  2 +-
 4 files changed, 40 insertions(+), 69 deletions(-)

diff --git a/example/ctc/README.md b/example/ctc/README.md
index e3a4d8c..9035582 100644
--- a/example/ctc/README.md
+++ b/example/ctc/README.md
@@ -1,8 +1,14 @@
 # CTC with Mxnet
-this is mx.contrib.sym.ctc_loss example. It was modified from example 
[warpctc](https://github.com/dmlc/mxnet/tree/master/example/warpctc) 
 
-# Core code
-this is core change in lstm.py
+## Overview
+This example is a modification of 
[warpctc](https://github.com/dmlc/mxnet/tree/master/example/warpctc)
+It demonstrates the usage of  ```mx.contrib.sym.ctc_loss``` 
+
+## Core code change
+
+The following implementation of ```lstm_unroll```  function is introduced in 
```lstm.py``` demonstrates the usage of
+```mx.contrib.sym.ctc_loss```.
+
 ```Cython
 def lstm_unroll(num_lstm_layer, seq_len,
 num_hidden, num_label):
@@ -49,68 +55,26 @@ def lstm_unroll(num_lstm_layer, seq_len,
 
 return mx.sym.Group([softmax_loss, ctc_loss])
 ```
-# Some Result
-If there were more training, the result would be better
 
+## Prerequisites
+
+Please ensure that following prerequisites are satisfied before running this 
examples.
+
+- ```captcha``` python package is installed.
+- ```cv2``` (or ```openCV```) python package is installed.
+- The test requires font file (```ttf``` format). The user either would need 
to create ```.\data\```  directory and place the font file in that directory. 
The user can also edit following line to specify path to the font file.
+```cython
+# you can get this font from http://font.ubuntu.com/
+self.captcha = ImageCaptcha(fonts=['./data/Xerox.ttf'])
 ```
-2017-07-08 13:22:01,155 Epoch[94] Batch [50]Speed: 4273.43 samples/sec 
Accuracy=0.808747
-2017-07-08 13:22:13,141 Epoch[94] Batch [100]  Speed: 4271.84 samples/sec  
Accuracy=0.786855
-2017-07-08 13:22:25,179 Epoch[94] Batch [150]  Speed: 4253.81 samples/sec  
Accuracy=0.810625
-2017-07-08 13:22:37,198 Epoch[94] Batch [200]  Speed: 4259.96 samples/sec  
Accuracy=0.808809
-2017-07-08 13:22:49,233 Epoch[94] Batch [250]  Speed: 4254.13 samples/sec  
Accuracy=0.806426
-2017-07-08 13:23:01,308 Epoch[94] Batch [300]  Speed: 4239.98 samples/sec  
Accuracy=0.817305
-2017-07-08 13:23:02,030 Epoch[94] Train-Accuracy=0.819336
-2017-07-08 13:23:02,030 Epoch[94] Time cost=73.092
-2017-07-08 13:23:02,101 Saved checkpoint to "ocr-0095.params"
-2017-07-08 13:23:07,192 Epoch[94] Validation-Accuracy=0.819417
-2017-07-08 13:23:20,579 Epoch[95] Batch [50]   Speed: 4288.76 samples/sec  
Accuracy=0.817459
-2017-07-08 13:23:32,573 Epoch[95] Batch [100]  Speed: 4268.75 samples/sec  
Accuracy=0.815215
-2017-07-08 13:23:44,635 Epoch[95] Batch [150]  Speed: 4244.85 samples/sec  
Accuracy=0.820215
-2017-07-08 13:23:56,670 Epoch[95] Batch [200]  Speed: 4254.38 samples/sec  
Accuracy=0.823613
-2017-07-08 13:24:08,650 Epoch[95] Batch [250]  Speed: 4273.83 samples/sec  
Accuracy=0.827109
-2017-07-08 13:24:20,680 Epoch[95] Batch [300]  Speed: 4256.49 samples/sec  
Accuracy=0.824961
-2017-07-08 13:24:21,401 Epoch[95] Train-Accuracy=0.840495
-2017-07-08 13:24:21,401 Epoch[95] Time cost=73.008
-2017-07-08 13:24:21,441 Saved checkpoint to "ocr-0096.params"
-2017-07-08 13:24:26,508 Epoch[95] Validation-Accuracy=0.834798
-2017-07-08 13:24:39,938 Epoch[96] Batch [50]   Speed: 4259.32 samples/sec  
Accuracy=0.825578
-2017-07-08 13:24:51,987 Epoch[96] Batch [100]  Speed: 4249.67 samples/sec  
Accuracy=0.826562
-2017-07-08 13:25:04,041 Epoch[96] Batch [150]  Speed: 4247.44 samples/sec  
Accuracy=0.831855
-2017-07-08 13:25:16,058 Epoch[96] Batch [200]  Speed: 4260.77 samples/sec  
Accuracy=0.830840
-2017-07-08 13:25:28,109 Epoch[96] Batch [250]  Speed: 4248.44 samples/sec  
Accuracy=0.827168
-2017-07-08 13:25:40,057 Epoch[96] Batch [300]  Speed: 4285.23 samples/sec  
Accuracy=0.832715
-2017-07-08 13:25:40,782 Epoch[96] Train-Accuracy=0.830729
-2017-07-08 

[GitHub] eric-haibin-lin closed pull request #9073: Updating the README files and examples in "ctc" and "recommenders" folder.

2018-01-03 Thread GitBox
eric-haibin-lin closed pull request #9073: Updating the README files and 
examples in "ctc" and "recommenders" folder.
URL: https://github.com/apache/incubator-mxnet/pull/9073
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/example/ctc/README.md b/example/ctc/README.md
index e3a4d8c085..9035582a53 100644
--- a/example/ctc/README.md
+++ b/example/ctc/README.md
@@ -1,8 +1,14 @@
 # CTC with Mxnet
-this is mx.contrib.sym.ctc_loss example. It was modified from example 
[warpctc](https://github.com/dmlc/mxnet/tree/master/example/warpctc) 
 
-# Core code
-this is core change in lstm.py
+## Overview
+This example is a modification of 
[warpctc](https://github.com/dmlc/mxnet/tree/master/example/warpctc)
+It demonstrates the usage of  ```mx.contrib.sym.ctc_loss``` 
+
+## Core code change
+
+The following implementation of ```lstm_unroll```  function is introduced in 
```lstm.py``` demonstrates the usage of
+```mx.contrib.sym.ctc_loss```.
+
 ```Cython
 def lstm_unroll(num_lstm_layer, seq_len,
 num_hidden, num_label):
@@ -49,68 +55,26 @@ def lstm_unroll(num_lstm_layer, seq_len,
 
 return mx.sym.Group([softmax_loss, ctc_loss])
 ```
-# Some Result
-If there were more training, the result would be better
 
+## Prerequisites
+
+Please ensure that following prerequisites are satisfied before running this 
examples.
+
+- ```captcha``` python package is installed.
+- ```cv2``` (or ```openCV```) python package is installed.
+- The test requires font file (```ttf``` format). The user either would need 
to create ```.\data\```  directory and place the font file in that directory. 
The user can also edit following line to specify path to the font file.
+```cython
+# you can get this font from http://font.ubuntu.com/
+self.captcha = ImageCaptcha(fonts=['./data/Xerox.ttf'])
 ```
-2017-07-08 13:22:01,155 Epoch[94] Batch [50]Speed: 4273.43 samples/sec 
Accuracy=0.808747
-2017-07-08 13:22:13,141 Epoch[94] Batch [100]  Speed: 4271.84 samples/sec  
Accuracy=0.786855
-2017-07-08 13:22:25,179 Epoch[94] Batch [150]  Speed: 4253.81 samples/sec  
Accuracy=0.810625
-2017-07-08 13:22:37,198 Epoch[94] Batch [200]  Speed: 4259.96 samples/sec  
Accuracy=0.808809
-2017-07-08 13:22:49,233 Epoch[94] Batch [250]  Speed: 4254.13 samples/sec  
Accuracy=0.806426
-2017-07-08 13:23:01,308 Epoch[94] Batch [300]  Speed: 4239.98 samples/sec  
Accuracy=0.817305
-2017-07-08 13:23:02,030 Epoch[94] Train-Accuracy=0.819336
-2017-07-08 13:23:02,030 Epoch[94] Time cost=73.092
-2017-07-08 13:23:02,101 Saved checkpoint to "ocr-0095.params"
-2017-07-08 13:23:07,192 Epoch[94] Validation-Accuracy=0.819417
-2017-07-08 13:23:20,579 Epoch[95] Batch [50]   Speed: 4288.76 samples/sec  
Accuracy=0.817459
-2017-07-08 13:23:32,573 Epoch[95] Batch [100]  Speed: 4268.75 samples/sec  
Accuracy=0.815215
-2017-07-08 13:23:44,635 Epoch[95] Batch [150]  Speed: 4244.85 samples/sec  
Accuracy=0.820215
-2017-07-08 13:23:56,670 Epoch[95] Batch [200]  Speed: 4254.38 samples/sec  
Accuracy=0.823613
-2017-07-08 13:24:08,650 Epoch[95] Batch [250]  Speed: 4273.83 samples/sec  
Accuracy=0.827109
-2017-07-08 13:24:20,680 Epoch[95] Batch [300]  Speed: 4256.49 samples/sec  
Accuracy=0.824961
-2017-07-08 13:24:21,401 Epoch[95] Train-Accuracy=0.840495
-2017-07-08 13:24:21,401 Epoch[95] Time cost=73.008
-2017-07-08 13:24:21,441 Saved checkpoint to "ocr-0096.params"
-2017-07-08 13:24:26,508 Epoch[95] Validation-Accuracy=0.834798
-2017-07-08 13:24:39,938 Epoch[96] Batch [50]   Speed: 4259.32 samples/sec  
Accuracy=0.825578
-2017-07-08 13:24:51,987 Epoch[96] Batch [100]  Speed: 4249.67 samples/sec  
Accuracy=0.826562
-2017-07-08 13:25:04,041 Epoch[96] Batch [150]  Speed: 4247.44 samples/sec  
Accuracy=0.831855
-2017-07-08 13:25:16,058 Epoch[96] Batch [200]  Speed: 4260.77 samples/sec  
Accuracy=0.830840
-2017-07-08 13:25:28,109 Epoch[96] Batch [250]  Speed: 4248.44 samples/sec  
Accuracy=0.827168
-2017-07-08 13:25:40,057 Epoch[96] Batch [300]  Speed: 4285.23 samples/sec  
Accuracy=0.832715
-2017-07-08 13:25:40,782 Epoch[96] Train-Accuracy=0.830729
-2017-07-08 13:25:40,782 Epoch[96] Time cost=73.098
-2017-07-08 13:25:40,821 Saved checkpoint to "ocr-0097.params"
-2017-07-08 13:25:45,886 Epoch[96] Validation-Accuracy=0.840820
-2017-07-08 13:25:59,283 Epoch[97] Batch [50]   Speed: 4271.85 samples/sec  
Accuracy=0.831648
-2017-07-08 13:26:11,243 Epoch[97] Batch [100]  Speed: 4280.89 samples/sec  
Accuracy=0.835371
-2017-07-08 13:26:23,263 Epoch[97] Batch [150]  Speed: 4259.89 samples/sec  
Accuracy=0.831094
-2017-07-08 13:26:35,230 Epoch[97] Batch [200]  Speed: 4278.40 samples/sec  
Accuracy=0.827129
-2017-07-08 13:26:47,199 Epoch[97] Batch 

[GitHub] aaronmarkham commented on a change in pull request #9073: Updating the README files and examples in "ctc" and "recommenders" folder.

2018-01-03 Thread GitBox
aaronmarkham commented on a change in pull request #9073: Updating the README 
files and examples in "ctc" and "recommenders" folder.
URL: https://github.com/apache/incubator-mxnet/pull/9073#discussion_r159547368
 
 

 ##
 File path: example/ctc/README.md
 ##
 @@ -49,68 +55,26 @@ def lstm_unroll(num_lstm_layer, seq_len,
 
 return mx.sym.Group([softmax_loss, ctc_loss])
 ```
-# Some Result
-If there were more training, the result would be better
 
+## Prerequisites
+
+Please ensure that following prerequisites are satisfied before running this 
examples.
+
+- ```captcha``` python package is installed.
+- ```cv2``` (or ```openCV```) python package is installed.
+- The test requires font file (```ttf``` format). The user either would need 
to create ```.\data\```  directory and place the font file in that directory. 
The user can also edit following line to specify path to the font file.
+```cython
+# you can get this font from http://font.ubuntu.com/
+self.captcha = ImageCaptcha(fonts=['./data/Xerox.ttf'])
 ```
-2017-07-08 13:22:01,155 Epoch[94] Batch [50]Speed: 4273.43 samples/sec 
Accuracy=0.808747
-2017-07-08 13:22:13,141 Epoch[94] Batch [100]  Speed: 4271.84 samples/sec  
Accuracy=0.786855
-2017-07-08 13:22:25,179 Epoch[94] Batch [150]  Speed: 4253.81 samples/sec  
Accuracy=0.810625
-2017-07-08 13:22:37,198 Epoch[94] Batch [200]  Speed: 4259.96 samples/sec  
Accuracy=0.808809
-2017-07-08 13:22:49,233 Epoch[94] Batch [250]  Speed: 4254.13 samples/sec  
Accuracy=0.806426
-2017-07-08 13:23:01,308 Epoch[94] Batch [300]  Speed: 4239.98 samples/sec  
Accuracy=0.817305
-2017-07-08 13:23:02,030 Epoch[94] Train-Accuracy=0.819336
-2017-07-08 13:23:02,030 Epoch[94] Time cost=73.092
-2017-07-08 13:23:02,101 Saved checkpoint to "ocr-0095.params"
-2017-07-08 13:23:07,192 Epoch[94] Validation-Accuracy=0.819417
-2017-07-08 13:23:20,579 Epoch[95] Batch [50]   Speed: 4288.76 samples/sec  
Accuracy=0.817459
-2017-07-08 13:23:32,573 Epoch[95] Batch [100]  Speed: 4268.75 samples/sec  
Accuracy=0.815215
-2017-07-08 13:23:44,635 Epoch[95] Batch [150]  Speed: 4244.85 samples/sec  
Accuracy=0.820215
-2017-07-08 13:23:56,670 Epoch[95] Batch [200]  Speed: 4254.38 samples/sec  
Accuracy=0.823613
-2017-07-08 13:24:08,650 Epoch[95] Batch [250]  Speed: 4273.83 samples/sec  
Accuracy=0.827109
-2017-07-08 13:24:20,680 Epoch[95] Batch [300]  Speed: 4256.49 samples/sec  
Accuracy=0.824961
-2017-07-08 13:24:21,401 Epoch[95] Train-Accuracy=0.840495
-2017-07-08 13:24:21,401 Epoch[95] Time cost=73.008
-2017-07-08 13:24:21,441 Saved checkpoint to "ocr-0096.params"
-2017-07-08 13:24:26,508 Epoch[95] Validation-Accuracy=0.834798
-2017-07-08 13:24:39,938 Epoch[96] Batch [50]   Speed: 4259.32 samples/sec  
Accuracy=0.825578
-2017-07-08 13:24:51,987 Epoch[96] Batch [100]  Speed: 4249.67 samples/sec  
Accuracy=0.826562
-2017-07-08 13:25:04,041 Epoch[96] Batch [150]  Speed: 4247.44 samples/sec  
Accuracy=0.831855
-2017-07-08 13:25:16,058 Epoch[96] Batch [200]  Speed: 4260.77 samples/sec  
Accuracy=0.830840
-2017-07-08 13:25:28,109 Epoch[96] Batch [250]  Speed: 4248.44 samples/sec  
Accuracy=0.827168
-2017-07-08 13:25:40,057 Epoch[96] Batch [300]  Speed: 4285.23 samples/sec  
Accuracy=0.832715
-2017-07-08 13:25:40,782 Epoch[96] Train-Accuracy=0.830729
-2017-07-08 13:25:40,782 Epoch[96] Time cost=73.098
-2017-07-08 13:25:40,821 Saved checkpoint to "ocr-0097.params"
-2017-07-08 13:25:45,886 Epoch[96] Validation-Accuracy=0.840820
-2017-07-08 13:25:59,283 Epoch[97] Batch [50]   Speed: 4271.85 samples/sec  
Accuracy=0.831648
-2017-07-08 13:26:11,243 Epoch[97] Batch [100]  Speed: 4280.89 samples/sec  
Accuracy=0.835371
-2017-07-08 13:26:23,263 Epoch[97] Batch [150]  Speed: 4259.89 samples/sec  
Accuracy=0.831094
-2017-07-08 13:26:35,230 Epoch[97] Batch [200]  Speed: 4278.40 samples/sec  
Accuracy=0.827129
-2017-07-08 13:26:47,199 Epoch[97] Batch [250]  Speed: 4277.77 samples/sec  
Accuracy=0.834258
-2017-07-08 13:26:59,257 Epoch[97] Batch [300]  Speed: 4245.93 samples/sec  
Accuracy=0.833770
-2017-07-08 13:26:59,971 Epoch[97] Train-Accuracy=0.844727
-2017-07-08 13:26:59,971 Epoch[97] Time cost=72.908
-2017-07-08 13:27:00,020 Saved checkpoint to "ocr-0098.params"
-2017-07-08 13:27:05,130 Epoch[97] Validation-Accuracy=0.827962
-2017-07-08 13:27:18,521 Epoch[98] Batch [50]   Speed: 4281.06 samples/sec  
Accuracy=0.834118
-2017-07-08 13:27:30,537 Epoch[98] Batch [100]  Speed: 4261.20 samples/sec  
Accuracy=0.835352
-2017-07-08 13:27:42,542 Epoch[98] Batch [150]  Speed: 4264.88 samples/sec  
Accuracy=0.839395
-2017-07-08 13:27:54,544 Epoch[98] Batch [200]  Speed: 4266.31 samples/sec  
Accuracy=0.836328
-2017-07-08 13:28:06,550 Epoch[98] Batch [250]  Speed: 4264.50 samples/sec  
Accuracy=0.841465
-2017-07-08 13:28:18,622 Epoch[98] Batch [300]  Speed: 4241.11 samples/sec  
Accuracy=0.831680
-2017-07-08 

[GitHub] nswamy commented on issue #9292: Runing MxNet

2018-01-03 Thread GitBox
nswamy commented on issue #9292: Runing MxNet
URL: 
https://github.com/apache/incubator-mxnet/issues/9292#issuecomment-355149988
 
 
   are you running on a machine that has a GPU ?


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] sxjscience commented on issue #9265: Add label_from_zero_one argument to LogisticLoss

2018-01-03 Thread GitBox
sxjscience commented on issue #9265: Add label_from_zero_one argument to 
LogisticLoss
URL: https://github.com/apache/incubator-mxnet/pull/9265#issuecomment-355149943
 
 
   @piiswrong I've renamed accordingly.


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] sxjscience commented on issue #9200: Fix the gradient of gather_nd

2018-01-03 Thread GitBox
sxjscience commented on issue #9200: Fix the gradient of gather_nd
URL: https://github.com/apache/incubator-mxnet/pull/9200#issuecomment-355149898
 
 
   @piiswrong I've renamed accordingly.


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 closed pull request #9108: update README.md with details on typical usage of the scripts

2018-01-03 Thread GitBox
eric-haibin-lin closed pull request #9108: update README.md with details on 
typical usage of the scripts
URL: https://github.com/apache/incubator-mxnet/pull/9108
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/example/rnn/bucketing/README.md b/example/rnn/bucketing/README.md
index 6baf1ecae9..0481609c23 100644
--- a/example/rnn/bucketing/README.md
+++ b/example/rnn/bucketing/README.md
@@ -3,11 +3,34 @@ RNN Example
 This folder contains RNN examples using high level mxnet.rnn interface.
 
 ## Data
-Run `get_ptb_data.sh` to download PenTreeBank data.
+1) Review the license for the PenTreeBank dataset and ensure that you agree to 
it. Then uncomment the lines in the 'get_ptb_data.sh' script that download the 
dataset.
+
+2) Run `get_ptb_data.sh` to download PenTreeBank data.
 
 ## Python
 
-- [lstm_bucketing.py](lstm_bucketing.py) PennTreeBank language model by using 
LSTM
+- Generate the PennTreeBank language model by using LSTM:
+
+  For Python2 (CPU support): can take 2+ hours on AWS-EC2-p2.16xlarge
+
+  $ python  [lstm_bucketing.py](lstm_bucketing.py) 
+
+  For Python3 (CPU support): can take 2+ hours on AWS-EC2-p2.16xlarge
+
+  $ python3 [lstm_bucketing.py](lstm_bucketing.py) 
+
+  Assuming your machine has 4 GPUs and you want to use all the 4 GPUs:
+
+  For Python2 (GPU support only): can take 50+ minutes on AWS-EC2-p2.16xlarge
+
+  $ python  --gpus 0,1,2,3 
[cudnn_lstm_bucketing.py](cudnn_lstm_bucketing.py) 
+
+  For Python3 (GPU support only): can take 50+ minutes on AWS-EC2-p2.16xlarge
+
+  $ python3 --gpus 0,1,2,3 
[cudnn_lstm_bucketing.py](cudnn_lstm_bucketing.py) 
+
+
+### Performance Note:
+
+More ```MXNET_GPU_WORKER_NTHREADS``` may lead to better performance. For 
setting ```MXNET_GPU_WORKER_NTHREADS```, please refer to [Environment 
Variables](http://mxnet.incubator.apache.org/how_to/env_var.html).
 
-Performance Note:
-More ```MXNET_GPU_WORKER_NTHREADS``` may lead to better performance. For 
setting ```MXNET_GPU_WORKER_NTHREADS```, please refer to [Environment 
Variables](https://mxnet.readthedocs.org/en/latest/how_to/env_var.html).


 


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 README.md with details on typical usage of the scripts (#9108)

2018-01-03 Thread haibin
This is an automated email from the ASF dual-hosted git repository.

haibin 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 996d548  update README.md with details on typical usage of the scripts 
(#9108)
996d548 is described below

commit 996d54817d23d1e0d35fd70394ed09c9d45342e2
Author: Bhavin Thaker 
AuthorDate: Wed Jan 3 14:34:50 2018 -0800

update README.md with details on typical usage of the scripts (#9108)
---
 example/rnn/bucketing/README.md | 31 +++
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/example/rnn/bucketing/README.md b/example/rnn/bucketing/README.md
index 6baf1ec..0481609 100644
--- a/example/rnn/bucketing/README.md
+++ b/example/rnn/bucketing/README.md
@@ -3,11 +3,34 @@ RNN Example
 This folder contains RNN examples using high level mxnet.rnn interface.
 
 ## Data
-Run `get_ptb_data.sh` to download PenTreeBank data.
+1) Review the license for the PenTreeBank dataset and ensure that you agree to 
it. Then uncomment the lines in the 'get_ptb_data.sh' script that download the 
dataset.
+
+2) Run `get_ptb_data.sh` to download PenTreeBank data.
 
 ## Python
 
-- [lstm_bucketing.py](lstm_bucketing.py) PennTreeBank language model by using 
LSTM
+- Generate the PennTreeBank language model by using LSTM:
+
+  For Python2 (CPU support): can take 2+ hours on AWS-EC2-p2.16xlarge
+
+  $ python  [lstm_bucketing.py](lstm_bucketing.py) 
+
+  For Python3 (CPU support): can take 2+ hours on AWS-EC2-p2.16xlarge
+
+  $ python3 [lstm_bucketing.py](lstm_bucketing.py) 
+
+  Assuming your machine has 4 GPUs and you want to use all the 4 GPUs:
+
+  For Python2 (GPU support only): can take 50+ minutes on AWS-EC2-p2.16xlarge
+
+  $ python  --gpus 0,1,2,3 
[cudnn_lstm_bucketing.py](cudnn_lstm_bucketing.py) 
+
+  For Python3 (GPU support only): can take 50+ minutes on AWS-EC2-p2.16xlarge
+
+  $ python3 --gpus 0,1,2,3 
[cudnn_lstm_bucketing.py](cudnn_lstm_bucketing.py) 
+
+
+### Performance Note:
+
+More ```MXNET_GPU_WORKER_NTHREADS``` may lead to better performance. For 
setting ```MXNET_GPU_WORKER_NTHREADS```, please refer to [Environment 
Variables](http://mxnet.incubator.apache.org/how_to/env_var.html).
 
-Performance Note:
-More ```MXNET_GPU_WORKER_NTHREADS``` may lead to better performance. For 
setting ```MXNET_GPU_WORKER_NTHREADS```, please refer to [Environment 
Variables](https://mxnet.readthedocs.org/en/latest/how_to/env_var.html).

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


[GitHub] anirudh2290 commented on a change in pull request #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
anirudh2290 commented on a change in pull request #8938: Add operator for 
dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#discussion_r159539941
 
 

 ##
 File path: src/operator/tensor/dot-inl.h
 ##
 @@ -228,8 +231,17 @@ inline bool DotForwardInferStorageType(const 
nnvm::NodeAttrs& attrs,
   if (!dispatched && lhs_stype == kCSRStorage && rhs_rsp_or_dns &&
   !param.transpose_a && !param.transpose_b) {
 // csr, rsp/dns -> dns
-dispatched = storage_type_assign(_stype, kDefaultStorage,
- dispatch_mode, DispatchMode::kFComputeEx);
+dispatched = storage_type_assign(_stype, kDefaultStorage, 
dispatch_mode,
+ DispatchMode::kFComputeEx);
+  }
+  if (!dispatched && lhs_stype == kDefaultStorage && rhs_stype == kCSRStorage 
&&
+  !param.transpose_a && !param.transpose_b) {
+// dns, csr -> csr
+const bool invalid_ctx = dev_mask != mshadow::cpu::kDevMask;
+const auto dispatch_ex = invalid_ctx ? DispatchMode::kFComputeFallback
+ : DispatchMode::kFComputeEx;
+dispatched = storage_type_assign(_stype, kCSRStorage, dispatch_mode,
+ dispatch_ex);
   }
 
 Review comment:
   Yes moving the logic to common path would be nice. I see multiple places 
where we don't have this check. For example, 
https://github.com/apache/incubator-mxnet/blob/d2a856a3a2abb4e72edc301b8b821f0b75f30722/src/operator/tensor/elemwise_unary_op_basic.cc#L65
 and 
https://github.com/apache/incubator-mxnet/blob/d2a856a3a2abb4e72edc301b8b821f0b75f30722/src/operator/tensor/elemwise_binary_scalar_op_basic.cc#L68
 . These also need to be fixed 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] anirudh2290 commented on a change in pull request #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
anirudh2290 commented on a change in pull request #8938: Add operator for 
dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#discussion_r159539941
 
 

 ##
 File path: src/operator/tensor/dot-inl.h
 ##
 @@ -228,8 +231,17 @@ inline bool DotForwardInferStorageType(const 
nnvm::NodeAttrs& attrs,
   if (!dispatched && lhs_stype == kCSRStorage && rhs_rsp_or_dns &&
   !param.transpose_a && !param.transpose_b) {
 // csr, rsp/dns -> dns
-dispatched = storage_type_assign(_stype, kDefaultStorage,
- dispatch_mode, DispatchMode::kFComputeEx);
+dispatched = storage_type_assign(_stype, kDefaultStorage, 
dispatch_mode,
+ DispatchMode::kFComputeEx);
+  }
+  if (!dispatched && lhs_stype == kDefaultStorage && rhs_stype == kCSRStorage 
&&
+  !param.transpose_a && !param.transpose_b) {
+// dns, csr -> csr
+const bool invalid_ctx = dev_mask != mshadow::cpu::kDevMask;
+const auto dispatch_ex = invalid_ctx ? DispatchMode::kFComputeFallback
+ : DispatchMode::kFComputeEx;
+dispatched = storage_type_assign(_stype, kCSRStorage, dispatch_mode,
+ dispatch_ex);
   }
 
 Review comment:
   Yes moving the logic to common path would be nice. I see multiple places 
where we don't have this check. For example, 
https://github.com/apache/incubator-mxnet/blob/d2a856a3a2abb4e72edc301b8b821f0b75f30722/src/operator/tensor/elemwise_unary_op_basic.cc#L65
 and 
https://github.com/apache/incubator-mxnet/blob/d2a856a3a2abb4e72edc301b8b821f0b75f30722/src/operator/tensor/elemwise_binary_scalar_op_basic.cc#L68
 . These need to be fixed 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] eric-haibin-lin commented on a change in pull request #9283: Fix custom op multi-gpu scaling

2018-01-03 Thread GitBox
eric-haibin-lin commented on a change in pull request #9283: Fix custom op 
multi-gpu scaling
URL: https://github.com/apache/incubator-mxnet/pull/9283#discussion_r159530705
 
 

 ##
 File path: src/operator/custom/custom-inl.h
 ##
 @@ -63,11 +64,80 @@ class Registry {
 return nullptr;
   }
 
-  static Registry* Get();
+  template
+  void Push(const Func& func,
+const OpContext& ctx,
+bool recording,
+bool training,
+const std::vector& arrs) {
+if (naive_engine_) {
+  func();
+  ctx.async_on_complete();
+  return;
+}
+std::unique_lock lock(mutex_);
+q_.push(
+  [=]() mutable {
+bool prev_recording = Imperative::Get()->set_is_recording(recording);
+bool prev_training = Imperative::Get()->set_is_training(training);
+
+func();
+
+Imperative::Get()->set_is_training(prev_training);
+Imperative::Get()->set_is_recording(prev_recording);
+
+std::vector vars;
+for (const auto& i : arrs) vars.push_back(i.var());
+Engine::Get()->PushSync([=](RunContext rctx) {
 
 Review comment:
   Will worker thread and main thread push operations to the engine at the same 
time?


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] jrosebr1 commented on issue #1302: Draw Validation Curves

2018-01-03 Thread GitBox
jrosebr1 commented on issue #1302: Draw Validation Curves
URL: 
https://github.com/apache/incubator-mxnet/issues/1302#issuecomment-355128662
 
 
   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] zhanghang1989 commented on issue #7938: instance norm and reflection padding

2018-01-03 Thread GitBox
zhanghang1989 commented on issue #7938: instance norm and reflection padding
URL: https://github.com/apache/incubator-mxnet/pull/7938#issuecomment-355127864
 
 
   Thanks @piiswrong! I made some changes to the doc.  


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] edmBernard commented on issue #1302: Draw Validation Curves

2018-01-03 Thread GitBox
edmBernard commented on issue #1302: Draw Validation Curves
URL: 
https://github.com/apache/incubator-mxnet/issues/1302#issuecomment-355127486
 
 
   Yes
   the standalone tensorboard maintained by dmlc: 
https://github.com/dmlc/tensorboard
   documentation on python API with a mxnet example: 
https://github.com/dmlc/tensorboard/tree/master/python


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] cjolivier01 opened a new pull request #9293: Make numpy functions return Symbol instead of numpy object array

2018-01-03 Thread GitBox
cjolivier01 opened a new pull request #9293: Make numpy functions return Symbol 
instead of numpy object array
URL: https://github.com/apache/incubator-mxnet/pull/9293
 
 
   ## Description ##
   @piiswrong 
   
   Fix comes from Eric (@piiswrong) from similar issue with NDArray
   
   Seen error would be something like:
   
   Traceback (most recent call last):
 File "../../python/troubleshoot.py", line 157, in 
   train(net, batch_size=8*1024, hybridize=True, ctx=ctx)
 File "../../python/troubleshoot.py", line 62, in train
   losses = [p50_p90_mixed_QL_mask_oos(Y, net(X)) for X, Y in zip(data, 
label)]
 File "/home/coolivie/src/DeepLearning/mxnet/python/mxnet/gluon/block.py", 
line 306, in __call__
   return self.forward(*args)
 File "/home/coolivie/src/DeepLearning/mxnet/python/mxnet/gluon/block.py", 
line 511, in forward
   return self._call_cached_op(x, *args)
 File "/home/coolivie/src/DeepLearning/mxnet/python/mxnet/gluon/block.py", 
line 417, in _call_cached_op
   self._build_cache(*args)
 File "/home/coolivie/src/DeepLearning/mxnet/python/mxnet/gluon/block.py", 
line 382, in _build_cache
   inputs, out = self._get_graph(*args)
 File "/home/coolivie/src/DeepLearning/mxnet/python/mxnet/gluon/block.py", 
line 374, in _get_graph
   out = self.hybrid_forward(symbol, *grouped_inputs, **params)  # pylint: 
disable=no-value-for-parameter
 File "../../python/troubleshoot.py", line 130, in hybrid_forward
   x = self.output(x)
 File "/home/coolivie/src/DeepLearning/mxnet/python/mxnet/gluon/block.py", 
line 306, in __call__
   return self.forward(*args)
 File "/home/coolivie/src/DeepLearning/mxnet/python/mxnet/gluon/block.py", 
line 523, in forward
   "Symbol or NDArray, but got %s"%type(x)
   AssertionError: HybridBlock requires the first argument to forward be either 
Symbol or NDArray, but got 
   
   
   ## Checklist ##
   ### Essentials ###
   - [ ] Passed code style checking (`make lint`)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - [ ] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   - If this change is a backward incompatible change, why must this change be 
made.
   - Interesting edge cases to note here
   


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 #9189: standard update for sparse sgd_mom_update

2018-01-03 Thread GitBox
eric-haibin-lin commented on a change in pull request #9189: standard update 
for sparse sgd_mom_update
URL: https://github.com/apache/incubator-mxnet/pull/9189#discussion_r159516903
 
 

 ##
 File path: src/operator/optimizer_op-inl.h
 ##
 @@ -460,6 +461,99 @@ inline void SGDMomUpdateRspRspRspImpl(const SGDMomParam& 
param,
  mom.data(), req, _blob);
 }
 
+template
 
 Review comment:
   Let's add some description on what the template params mean 


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 #8805: Release Branch 1.0 crashing for several tests in CUDA 7.5 docker containers.

2018-01-03 Thread GitBox
szha commented on issue #8805: Release Branch 1.0 crashing for several tests in 
CUDA 7.5 docker containers.
URL: 
https://github.com/apache/incubator-mxnet/issues/8805#issuecomment-355115711
 
 
   Thanks. Given that this is a compatibility issue in 7.5 curand and there's 
no plan to fix for curand, we won't be fixing this.


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 closed issue #8805: Release Branch 1.0 crashing for several tests in CUDA 7.5 docker containers.

2018-01-03 Thread GitBox
szha closed issue #8805: Release Branch 1.0 crashing for several tests in CUDA 
7.5 docker containers.
URL: https://github.com/apache/incubator-mxnet/issues/8805
 
 
   


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 #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
eric-haibin-lin commented on a change in pull request #8938: Add operator for 
dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#discussion_r159513000
 
 

 ##
 File path: tests/python/unittest/test_sparse_operator.py
 ##
 @@ -1248,10 +1273,12 @@ def test_sparse_dot_zero_output(lhs_shape, trans_lhs, 
rhs_num_cols):
 test_dot_csr(lhs_shape, (lhs_shape[0], 1), 'default', True,  lhs_d, 
rhs_d)  # (vector kernel)
 test_dot_csr(lhs_shape, (lhs_shape[1], rnd.randint(5, 10)), 'default', 
False, lhs_d, rhs_d)  # test gpu SpMM
 test_dot_csr(lhs_shape, (lhs_shape[0], rnd.randint(5, 10)), 'default', 
True, lhs_d, rhs_d)  # (scalar kernel)
+test_dot_dns_csr(lhs_shape, (lhs_shape[1], rnd.randint(500, 1000)), 
lhs_d, lhs_d)
 
 Review comment:
   randint(50,200) is large (and slow) enough for testing. No need to increase 
the dim to 1000.


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 #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
eric-haibin-lin commented on a change in pull request #8938: Add operator for 
dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#discussion_r159512289
 
 

 ##
 File path: src/operator/tensor/dot-inl.h
 ##
 @@ -228,8 +231,17 @@ inline bool DotForwardInferStorageType(const 
nnvm::NodeAttrs& attrs,
   if (!dispatched && lhs_stype == kCSRStorage && rhs_rsp_or_dns &&
   !param.transpose_a && !param.transpose_b) {
 // csr, rsp/dns -> dns
-dispatched = storage_type_assign(_stype, kDefaultStorage,
- dispatch_mode, DispatchMode::kFComputeEx);
+dispatched = storage_type_assign(_stype, kDefaultStorage, 
dispatch_mode,
+ DispatchMode::kFComputeEx);
+  }
+  if (!dispatched && lhs_stype == kDefaultStorage && rhs_stype == kCSRStorage 
&&
+  !param.transpose_a && !param.transpose_b) {
+// dns, csr -> csr
+const bool invalid_ctx = dev_mask != mshadow::cpu::kDevMask;
+const auto dispatch_ex = invalid_ctx ? DispatchMode::kFComputeFallback
+ : DispatchMode::kFComputeEx;
+dispatched = storage_type_assign(_stype, kCSRStorage, dispatch_mode,
+ dispatch_ex);
   }
 
 Review comment:
   Hmm. we should log storage fallback as long as dispatch mode is 
dispatch_fallback:
   
https://github.com/apache/incubator-mxnet/blob/d2a856a3a2abb4e72edc301b8b821f0b75f30722/src/operator/elemwise_op_common.h#L79-L81
   
   Maybe I should move this logic to the common path instead of letting 
developers specify that in operators 
   
https://github.com/apache/incubator-mxnet/blob/master/src/executor/infer_graph_attr_pass.cc#L45-L54
 
   


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 #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
eric-haibin-lin commented on a change in pull request #8938: Add operator for 
dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#discussion_r159514115
 
 

 ##
 File path: src/operator/tensor/dot-inl.h
 ##
 @@ -527,6 +539,80 @@ struct DotCsrTransRspRspByRowBlocks {
   }
 };
 
+/*!
+ * \brief CPU Kernel of PopulateCsrForNNC
+ * Parallelization by individual rows
+ * Populates the indptr and indices array
+ * based on number of non zero columns
+ */
+struct PopulateCsrForNNC {
+  /*!
+   * \brief
+   * \param i the i-th thread
+   * \param nnc_idx all non zero column indexes
+   * \param indptr_out indptr array for output
+   * \param col_idx_out column indices for output
+   * \param nnc number of non zero columns in the output
+   * \param num_rows_l number of rows in lhs
+   */
+  template 
+  MSHADOW_CINLINE static void Map(int i, const CType* nnc_idx,
+  IType* indptr_out, CType* col_idx_out,
+  const nnvm::dim_t nnc,
+  const nnvm::dim_t num_rows_l) {
+const CType start_idx = i * nnc;
+nnvm::dim_t cur = 0;
+indptr_out[i] = start_idx;
+if (i == static_cast(num_rows_l - 1)) indptr_out[i + 1] = 
indptr_out[i] + nnc;
 
 Review comment:
   As we are adding large array support in the future, it's more appropriate to 
cast i up to `dim_t` instead of cast num_rows_l down to `int`. 


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] cliffwoolley commented on issue #8805: Release Branch 1.0 crashing for several tests in CUDA 7.5 docker containers.

2018-01-03 Thread GitBox
cliffwoolley commented on issue #8805: Release Branch 1.0 crashing for several 
tests in CUDA 7.5 docker containers.
URL: 
https://github.com/apache/incubator-mxnet/issues/8805#issuecomment-355111443
 
 
   I'm not aware of any such plan.


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 #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
eric-haibin-lin commented on a change in pull request #8938: Add operator for 
dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#discussion_r159513184
 
 

 ##
 File path: src/operator/tensor/dot-inl.h
 ##
 @@ -811,6 +897,96 @@ inline void DotCsrRspRspImpl(const OpContext& ctx,
   });
 }
 
+/*
+ * \brief CPU Impl of dot(dns, csr) = csr
+ */
+template
+inline void DotDnsCsrCsrImpl(const OpContext& ctx,
+ const TBlob& lhs, const NDArray& rhs,
+ const OpReqType req, NDArray* ret) {
+  if (kNullOp == req) return;
+
+  CHECK_EQ(req, kWriteTo);
+  CHECK_EQ(rhs.storage_type(), kCSRStorage);
+
+  using namespace mshadow;
+  using namespace mshadow::expr;
+  using nnvm::dim_t;
+
+  /*Initialize data structures*/
 
 Review comment:
   nit: space after /*


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 #8938: Add operator for dot(dns, csr) = csr

2018-01-03 Thread GitBox
eric-haibin-lin commented on a change in pull request #8938: Add operator for 
dot(dns, csr) = csr
URL: https://github.com/apache/incubator-mxnet/pull/8938#discussion_r159510905
 
 

 ##
 File path: include/mxnet/ndarray.h
 ##
 @@ -305,7 +305,10 @@ class NDArray {
   bool fresh_out_grad() const;
   /*! \return updated grad state in entry_ */
   void set_fresh_out_grad(bool state) const;
-  // returns true if a sparse ndarray's aux_data and storage are initialized
+  /*! \brief Returns true if a sparse ndarray's aux_data and storage are 
initialized
+   * Returns false if the indices array shape is inconsistent
 
 Review comment:
   "Returns false if the indices array shape is inconsistent" -> it actually 
throws an exception without returning false


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 issue #7938: instance norm and reflection padding

2018-01-03 Thread GitBox
piiswrong commented on issue #7938: instance norm and reflection padding
URL: https://github.com/apache/incubator-mxnet/pull/7938#issuecomment-355110211
 
 
   see the other ops for doc format.
   
   Also please add test cases


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: Contrib operators for object-detection bounding box related stuffs (#8603)

2018-01-03 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 7e7cf3a  Contrib operators for object-detection bounding box related 
stuffs (#8603)
7e7cf3a is described below

commit 7e7cf3a65ae8c7b6fe80b3eedc89d5220b92815b
Author: Joshua Z. Zhang 
AuthorDate: Wed Jan 3 11:53:58 2018 -0800

Contrib operators for object-detection bounding box related stuffs (#8603)

* add box_nms, box_iou, bipartite_matching

* add more test cases
---
 src/operator/contrib/bounding_box-inl.h| 730 +
 src/operator/contrib/bounding_box.cc   | 194 +++
 src/operator/contrib/bounding_box.cu   |  50 ++
 tests/python/unittest/test_contrib_operator.py | 231 
 4 files changed, 1205 insertions(+)

diff --git a/src/operator/contrib/bounding_box-inl.h 
b/src/operator/contrib/bounding_box-inl.h
new file mode 100644
index 000..24ee8e7
--- /dev/null
+++ b/src/operator/contrib/bounding_box-inl.h
@@ -0,0 +1,730 @@
+/*
+ * 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 bounding_box-inl.h
+ * \brief bounding box util functions and operators
+ * \author Joshua Zhang
+*/
+#ifndef MXNET_OPERATOR_CONTRIB_BOUNDING_BOX_INL_H_
+#define MXNET_OPERATOR_CONTRIB_BOUNDING_BOX_INL_H_
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "../mshadow_op.h"
+#include "../mxnet_op.h"
+#include "../operator_common.h"
+#include "../tensor/sort_op.h"
+
+namespace mxnet {
+namespace op {
+namespace box_common_enum {
+enum BoxType {kCorner, kCenter};
+}
+namespace box_nms_enum {
+enum BoxNMSOpInputs {kData};
+enum BoxNMSOpOutputs {kOut, kTemp};
+enum BoxNMSOpResource {kTempSpace};
+}  // box_nms_enum
+
+struct BoxNMSParam : public dmlc::Parameter {
+  float overlap_thresh;
+  int topk;
+  int coord_start;
+  int score_index;
+  int id_index;
+  bool force_suppress;
+  int in_format;
+  int out_format;
+  DMLC_DECLARE_PARAMETER(BoxNMSParam) {
+DMLC_DECLARE_FIELD(overlap_thresh).set_default(0.5)
+.describe("Overlapping(IoU) threshold to suppress object with smaller 
score.");
+DMLC_DECLARE_FIELD(topk).set_default(-1)
+.describe("Apply nms to topk boxes with descending scores, -1 to no 
restriction.");
+DMLC_DECLARE_FIELD(coord_start).set_default(2)
+.describe("Start index of the consecutive 4 coordinates.");
+DMLC_DECLARE_FIELD(score_index).set_default(1)
+.describe("Index of the scores/confidence of boxes.");
+DMLC_DECLARE_FIELD(id_index).set_default(-1)
+.describe("Optional, index of the class categories, -1 to disable.");
+DMLC_DECLARE_FIELD(force_suppress).set_default(false)
+.describe("Optional, if set false and id_index is provided, nms will only 
apply"
+" to boxes belongs to the same category");
+DMLC_DECLARE_FIELD(in_format).set_default(box_common_enum::kCorner)
+.add_enum("corner", box_common_enum::kCorner)
+.add_enum("center", box_common_enum::kCenter)
+.describe("The input box encoding type. \n"
+" \"corner\" means boxes are encoded as [xmin, ymin, xmax, ymax],"
+" \"center\" means boxes are encodes as [x, y, width, height].");
+DMLC_DECLARE_FIELD(out_format).set_default(box_common_enum::kCorner)
+.add_enum("corner", box_common_enum::kCorner)
+.add_enum("center", box_common_enum::kCenter)
+.describe("The output box encoding type. \n"
+" \"corner\" means boxes are encoded as [xmin, ymin, xmax, ymax],"
+" \"center\" means boxes are encodes as [x, y, width, height].");
+  }
+};  // BoxNMSParam
+
+inline bool BoxNMSShape(const nnvm::NodeAttrs& attrs,
+   std::vector *in_attrs,
+   std::vector *out_attrs) {
+  const BoxNMSParam& param = nnvm::get(attrs.parsed);
+  CHECK_EQ(in_attrs->size(), 1U);
+  CHECK_EQ(out_attrs->size(), 2U);
+  if (in_attrs->at(0).ndim() == 0U && out_attrs->at(0).ndim() == 0U) {
+return false;
+  }
+
+  TShape& ishape = (*in_attrs)[0];
+  int indim = ishape.ndim();
+  

[GitHub] piiswrong closed pull request #8603: Contrib operators for object-detection bounding box related stuffs

2018-01-03 Thread GitBox
piiswrong closed pull request #8603: Contrib operators for object-detection 
bounding box related stuffs
URL: https://github.com/apache/incubator-mxnet/pull/8603
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/operator/contrib/bounding_box-inl.h 
b/src/operator/contrib/bounding_box-inl.h
new file mode 100644
index 00..24ee8e78ea
--- /dev/null
+++ b/src/operator/contrib/bounding_box-inl.h
@@ -0,0 +1,730 @@
+/*
+ * 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 bounding_box-inl.h
+ * \brief bounding box util functions and operators
+ * \author Joshua Zhang
+*/
+#ifndef MXNET_OPERATOR_CONTRIB_BOUNDING_BOX_INL_H_
+#define MXNET_OPERATOR_CONTRIB_BOUNDING_BOX_INL_H_
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "../mshadow_op.h"
+#include "../mxnet_op.h"
+#include "../operator_common.h"
+#include "../tensor/sort_op.h"
+
+namespace mxnet {
+namespace op {
+namespace box_common_enum {
+enum BoxType {kCorner, kCenter};
+}
+namespace box_nms_enum {
+enum BoxNMSOpInputs {kData};
+enum BoxNMSOpOutputs {kOut, kTemp};
+enum BoxNMSOpResource {kTempSpace};
+}  // box_nms_enum
+
+struct BoxNMSParam : public dmlc::Parameter {
+  float overlap_thresh;
+  int topk;
+  int coord_start;
+  int score_index;
+  int id_index;
+  bool force_suppress;
+  int in_format;
+  int out_format;
+  DMLC_DECLARE_PARAMETER(BoxNMSParam) {
+DMLC_DECLARE_FIELD(overlap_thresh).set_default(0.5)
+.describe("Overlapping(IoU) threshold to suppress object with smaller 
score.");
+DMLC_DECLARE_FIELD(topk).set_default(-1)
+.describe("Apply nms to topk boxes with descending scores, -1 to no 
restriction.");
+DMLC_DECLARE_FIELD(coord_start).set_default(2)
+.describe("Start index of the consecutive 4 coordinates.");
+DMLC_DECLARE_FIELD(score_index).set_default(1)
+.describe("Index of the scores/confidence of boxes.");
+DMLC_DECLARE_FIELD(id_index).set_default(-1)
+.describe("Optional, index of the class categories, -1 to disable.");
+DMLC_DECLARE_FIELD(force_suppress).set_default(false)
+.describe("Optional, if set false and id_index is provided, nms will only 
apply"
+" to boxes belongs to the same category");
+DMLC_DECLARE_FIELD(in_format).set_default(box_common_enum::kCorner)
+.add_enum("corner", box_common_enum::kCorner)
+.add_enum("center", box_common_enum::kCenter)
+.describe("The input box encoding type. \n"
+" \"corner\" means boxes are encoded as [xmin, ymin, xmax, ymax],"
+" \"center\" means boxes are encodes as [x, y, width, height].");
+DMLC_DECLARE_FIELD(out_format).set_default(box_common_enum::kCorner)
+.add_enum("corner", box_common_enum::kCorner)
+.add_enum("center", box_common_enum::kCenter)
+.describe("The output box encoding type. \n"
+" \"corner\" means boxes are encoded as [xmin, ymin, xmax, ymax],"
+" \"center\" means boxes are encodes as [x, y, width, height].");
+  }
+};  // BoxNMSParam
+
+inline bool BoxNMSShape(const nnvm::NodeAttrs& attrs,
+   std::vector *in_attrs,
+   std::vector *out_attrs) {
+  const BoxNMSParam& param = nnvm::get(attrs.parsed);
+  CHECK_EQ(in_attrs->size(), 1U);
+  CHECK_EQ(out_attrs->size(), 2U);
+  if (in_attrs->at(0).ndim() == 0U && out_attrs->at(0).ndim() == 0U) {
+return false;
+  }
+
+  TShape& ishape = (*in_attrs)[0];
+  int indim = ishape.ndim();
+  CHECK(indim >= 2)
+<< "input must have dim >= 2"
+<< " the last two dimensions are num_box and box_width "
+<< ishape << " provided";
+  int width_elem = ishape[indim - 1];
+  int expected = 5;
+  if (param.id_index > 0) {
+expected += 1;
+  }
+  CHECK_GE(width_elem, expected)
+<< "the last dimension must have at least 5 elements"
+<< " namely (score, coordinates x 4) "
+<< width_elem << " provided, " << expected << " expected.";
+  // check indices
+  int coord_start = param.coord_start;
+  int 

[GitHub] sxjscience commented on issue #9265: Add label_from_zero_one argument to LogisticLoss

2018-01-03 Thread GitBox
sxjscience commented on issue #9265: Add label_from_zero_one argument to 
LogisticLoss
URL: https://github.com/apache/incubator-mxnet/pull/9265#issuecomment-355108751
 
 
   Sounds good


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 #9224: fix trainer: init kvstore before load states

2018-01-03 Thread GitBox
piiswrong closed pull request #9224: fix trainer: init kvstore before load 
states
URL: https://github.com/apache/incubator-mxnet/pull/9224
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/python/mxnet/gluon/trainer.py b/python/mxnet/gluon/trainer.py
index f3a1460958..56d0332916 100644
--- a/python/mxnet/gluon/trainer.py
+++ b/python/mxnet/gluon/trainer.py
@@ -223,6 +223,9 @@ def load_states(self, fname):
 fname : str
 Path to input states file.
 """
+if not self._kv_initialized:
+self._init_kvstore()
+
 if self._update_on_kvstore:
 self._kvstore.load_optimizer_states(fname)
 self._optimizer = self._kvstore._updater.optimizer


 


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 #8603: Contrib operators for object-detection bounding box related stuffs

2018-01-03 Thread GitBox
piiswrong commented on a change in pull request #8603: Contrib operators for 
object-detection bounding box related stuffs
URL: https://github.com/apache/incubator-mxnet/pull/8603#discussion_r159511264
 
 

 ##
 File path: src/operator/contrib/bounding_box.cc
 ##
 @@ -0,0 +1,194 @@
+/*
+ * 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.
+ */
+
+ /*!
+  *  Copyright (c) 2017 by Contributors
+  * \file bounding_box.cc
+  * \brief Bounding box util functions and operators
+  * \author Joshua Zhang
+  */
+
+#include "./bounding_box-inl.h"
+#include "../elemwise_op_common.h"
+
+namespace mxnet {
+namespace op {
+DMLC_REGISTER_PARAMETER(BoxNMSParam);
+DMLC_REGISTER_PARAMETER(BoxOverlapParam);
+DMLC_REGISTER_PARAMETER(BipartiteMatchingParam);
+
+NNVM_REGISTER_OP(_contrib_box_nms)
+.add_alias("_contrib_box_non_maximum_suppression")
+.describe(R"code(Apply non-maximum suppression to input.
+
+The output will be sorted in descending order according to `score`. Boxes with
+overlaps larger than `overlap_thresh` and smaller scores will be removed and
+filled with -1, the corresponding position will be recorded for backward 
propogation.
+
+During back-propagation, the gradient will be copied to the original
+position according to the input index. For positions that have been suppressed,
+the in_grad will be assigned 0.
+In summary, gradients are sticked to its boxes, will either be moved or 
discarded
+according to its original index in input.
+
+Input requirements:
+1. Input tensor have at least 2 dimensions, (n, k), any higher dims will be 
regarded
+as batch, e.g. (a, b, c, d, n, k) == (a*b*c*d, n, k)
+2. n is the number of boxes in each batch
+3. k is the width of each box item.
+
+By default, a box is [id, score, xmin, ymin, xmax, ymax, ...],
+additional elements are allowed.
+- `id_index`: optional, use -1 to ignore, useful if `force_suppress=False`, 
which means
+we will skip highly overlapped boxes if one is `apple` while the other is 
`car`.
+- `coord_start`: required, default=2, the starting index of the 4 coordinates.
+Two formats are supported:
+  `corner`: [xmin, ymin, xmax, ymax]
+  `center`: [x, y, width, height]
+- `score_index`: required, default=1, box score/confidence.
+When two boxes overlap IOU > `overlap_thresh`, the one with smaller score will 
be suppressed.
+- `in_format` and `out_format`: default='corner', specify in/out box formats.
+
+Examples::
+
+  x = [[0, 0.5, 0.1, 0.1, 0.2, 0.2], [1, 0.4, 0.1, 0.1, 0.2, 0.2],
+   [0, 0.3, 0.1, 0.1, 0.14, 0.14], [2, 0.6, 0.5, 0.5, 0.7, 0.8]]
+  box_nms(x, overlap_thresh=0.1, coord_start=2, score_index=1, id_index=0,
+  force_suppress=True, in_format='corner', out_typ='corner') =
+  [[2, 0.6, 0.5, 0.5, 0.7, 0.8], [0, 0.5, 0.1, 0.1, 0.2, 0.2],
+   [-1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1]]
+  out_grad = [[0.1, 0.1, 0.1, 0.1, 0.1, 0.1], [0.2, 0.2, 0.2, 0.2, 0.2, 0.2],
+  [0.3, 0.3, 0.3, 0.3, 0.3, 0.3], [0.4, 0.4, 0.4, 0.4, 0.4, 0.4]]
+  # exe.backward
+  in_grad = [[0.2, 0.2, 0.2, 0.2, 0.2, 0.2], [0, 0, 0, 0, 0, 0],
+ [0, 0, 0, 0, 0, 0], [0.1, 0.1, 0.1, 0.1, 0.1, 0.1]]
+
+)code" ADD_FILELINE)
+.set_num_inputs(1)
+.set_num_outputs(2)
+.set_attr_parser(ParamParser)
+.set_attr("FNumVisibleOutputs", 
BoxNMSNumVisibleOutputs)
+.set_attr("FInferShape", BoxNMSShape)
+.set_attr("FInferType", ElemwiseType<1, 2>)
+.set_attr("FResourceRequest",
+  [](const NodeAttrs& attrs) {
+return std::vector{ResourceRequest::kTempSpace};
+  })
+.set_attr("FCompute", BoxNMSForward)
+.set_attr("FGradient", 
ElemwiseGradUseOut{"_backward_contrib_box_nms"})
+.add_argument("data", "NDArray-or-Symbol", "The input")
+.add_arguments(BoxNMSParam::__FIELDS__());
+
+NNVM_REGISTER_OP(_backward_contrib_box_nms)
+.set_num_inputs(3)
+.set_num_outputs(1)
+.set_attr_parser(ParamParser)
+.set_attr("TIsBackward", true)
+.set_attr("FCompute", BoxNMSBackward)
+.add_arguments(BoxNMSParam::__FIELDS__());
+
+NNVM_REGISTER_OP(_contrib_box_iou)
+.describe(R"doc(Bounding box overlap of two arrays.
+  The overlap is defined as Intersection-over-Union, aka, IOU.
+  - lhs: (a_1, a_2, ..., a_n, 4) array
+  - rhs: (b_1, b_2, ..., b_n, 4) array
+  - output: (a_1, a_2, ..., a_n, b_1, b_2, ..., 

[GitHub] szha commented on issue #8805: Release Branch 1.0 crashing for several tests in CUDA 7.5 docker containers.

2018-01-03 Thread GitBox
szha commented on issue #8805: Release Branch 1.0 crashing for several tests in 
CUDA 7.5 docker containers.
URL: 
https://github.com/apache/incubator-mxnet/issues/8805#issuecomment-355107812
 
 
   @DickJC123 is there any plan to patch 7.5 curand?


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 issue #8738: Fix custom op - infer_storage_type_backward

2018-01-03 Thread GitBox
piiswrong commented on issue #8738: Fix custom op - infer_storage_type_backward
URL: https://github.com/apache/incubator-mxnet/pull/8738#issuecomment-355106620
 
 
   This will need to be refactored after this fix is merged: 
https://github.com/apache/incubator-mxnet/pull/9283


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: FTML optimizer implementation (#9262)

2018-01-03 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 12cb0d2  FTML optimizer implementation (#9262)
12cb0d2 is described below

commit 12cb0d20c7feb0ba1aa6fa6dd1208af8f2fb230c
Author: Ziyue Huang 
AuthorDate: Thu Jan 4 03:31:55 2018 +0800

FTML optimizer implementation (#9262)

* ftml implemention

* c++ version and test

* merge WD into gradients
---
 python/mxnet/optimizer.py   | 51 ++-
 src/operator/optimizer_op-inl.h | 89 +
 src/operator/optimizer_op.cc| 33 
 src/operator/optimizer_op.cu|  3 ++
 tests/python/unittest/test_optimizer.py | 69 -
 5 files changed, 243 insertions(+), 2 deletions(-)

diff --git a/python/mxnet/optimizer.py b/python/mxnet/optimizer.py
index 78c8789..59898c9 100644
--- a/python/mxnet/optimizer.py
+++ b/python/mxnet/optimizer.py
@@ -25,7 +25,7 @@ import numpy
 from .base import py_str
 from .ndarray import (NDArray, zeros, clip, sqrt, cast, maximum, abs as NDabs)
 from .ndarray import (sgd_update, sgd_mom_update, adam_update, rmsprop_update, 
rmspropalex_update,
-  mp_sgd_update, mp_sgd_mom_update, square, ftrl_update)
+  mp_sgd_update, mp_sgd_mom_update, square, ftrl_update, 
ftml_update)
 from .ndarray import _internal
 from .ndarray import op
 from .ndarray import sparse
@@ -529,6 +529,55 @@ class SGD(Optimizer):
 self._update_impl(index, weight, grad, state,
   multi_precision=use_multi_precision)
 
+
+@register
+class FTML(Optimizer):
+"""The FTML optimizer.
+
+This class implements the optimizer described in
+*FTML - Follow the Moving Leader in Deep Learning*,
+available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
+
+This optimizer accepts the following parameters in addition to those 
accepted
+by :class:`.Optimizer`.
+
+Parameters
+--
+beta1 : float, optional
+0 < beta1 < 1. Generally close to 0.5.
+beta2 : float, optional
+0 < beta2 < 1. Generally close to 1.
+epsilon : float, optional
+Small value to avoid division by 0.
+"""
+def __init__(self, beta1=0.6, beta2=0.999, epsilon=1e-8, **kwargs):
+super(FTML, self).__init__(**kwargs)
+self.beta1 = beta1
+self.beta2 = beta2
+self.epsilon = epsilon
+
+def create_state(self, index, weight):
+return (zeros(weight.shape, weight.context, dtype=weight.dtype), # d_0
+zeros(weight.shape, weight.context, dtype=weight.dtype), # v_0
+zeros(weight.shape, weight.context, dtype=weight.dtype)) # z_0
+
+def update(self, index, weight, grad, state):
+assert(isinstance(weight, NDArray))
+assert(isinstance(grad, NDArray))
+self._update_count(index)
+lr = self._get_lr(index)
+wd = self._get_wd(index)
+t = self._index_update_count[index]
+
+kwargs = {'beta1': self.beta1, 'beta2': self.beta2, 'epsilon': 
self.epsilon,
+  'rescale_grad': self.rescale_grad, 't': t}
+if self.clip_gradient:
+kwargs['clip_grad'] = self.clip_gradient
+
+prev_d, prev_v, prev_z = state
+ftml_update(weight, grad, prev_d, prev_v, prev_z, out=weight,
+lr=lr, wd=wd, **kwargs)
+
 # pylint: enable=line-too-long
 @register
 class DCASGD(Optimizer):
diff --git a/src/operator/optimizer_op-inl.h b/src/operator/optimizer_op-inl.h
index 5aad48e..a6b32b1 100644
--- a/src/operator/optimizer_op-inl.h
+++ b/src/operator/optimizer_op-inl.h
@@ -485,6 +485,95 @@ inline void SGDMomUpdateEx(const nnvm::NodeAttrs& attrs,
   }
 }
 
+
+struct FTMLParam : public dmlc::Parameter {
+  float lr;
+  float beta1;
+  float beta2;
+  double epsilon;
+  int t;
+  float wd;
+  float rescale_grad;
+  float clip_grad;
+  DMLC_DECLARE_PARAMETER(FTMLParam) {
+DMLC_DECLARE_FIELD(lr)
+.describe("Learning rate.");
+DMLC_DECLARE_FIELD(beta1)
+.set_default(0.6f)
+.set_range(0.0f, 1.0f)
+.describe("Generally close to 0.5.");
+DMLC_DECLARE_FIELD(beta2)
+.set_default(0.999f)
+.set_range(0.0f, 1.0f)
+.describe("Generally close to 1.");
+DMLC_DECLARE_FIELD(epsilon)
+.set_default(1e-8f)
+.describe("Epsilon to prevent div 0.");
+DMLC_DECLARE_FIELD(t)
+.describe("Number of update.");
+DMLC_DECLARE_FIELD(wd)
+.set_default(0.0f)
+.describe("Weight decay augments the objective function with a "
+  "regularization term that penalizes large weights. "
+  "The penalty scales with the square of the magnitude of each 
weight.");
+DMLC_DECLARE_FIELD(rescale_grad)
+

[GitHub] szha closed issue #9211: mx.io.NDArrayIter with scipy.sparse, last batch becomes dense and with no warning upfront

2018-01-03 Thread GitBox
szha closed issue #9211: mx.io.NDArrayIter with scipy.sparse, last batch 
becomes dense and with no warning upfront
URL: https://github.com/apache/incubator-mxnet/issues/9211
 
 
   


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


  1   2   >