[GitHub] anirudh2290 commented on issue #9772: ndarray indexing issues

2018-02-14 Thread GitBox
anirudh2290 commented on issue #9772: ndarray indexing issues
URL: 
https://github.com/apache/incubator-mxnet/issues/9772#issuecomment-365836694
 
 
   @reminisce verified that it works for np.int64 on python2, doesn't work for 
np.int32. For python3, it doesnt work for either np.int32 or np.int64. This is 
probably because in python2, the int is 64 bit because of python build on my 
machine and isinstance check passed for np.int64. In python3 since int is 
changed and is not related to np.int32 or np.int64,  it fails isinstance checks 
for both np.int32 and np.int64.


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 #9772: ndarray indexing issues

2018-02-14 Thread GitBox
anirudh2290 commented on issue #9772: ndarray indexing issues
URL: 
https://github.com/apache/incubator-mxnet/issues/9772#issuecomment-365836694
 
 
   @reminisce verified that it works for np.int64 on python2, doesn't work for 
np.int32. For python3, it doesnt work for either np.int32 or np.int64. This is 
probably because in python2, the int is 64 bit because of python build on my 
machine and isinstance check passed for np.int64. In python3 since int is 
changed and is not related to np.int32 or np.int64,  it fail isinstance checks 
for both np.int32 and np.int64.


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 #9772: ndarray indexing issues

2018-02-14 Thread GitBox
anirudh2290 commented on issue #9772: ndarray indexing issues
URL: 
https://github.com/apache/incubator-mxnet/issues/9772#issuecomment-365816203
 
 
   @reminisce I wasnt able to reproduce the issue for python 2. The int type 
changed in python3 and the type is not related to numpy classes


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] pengzhao-intel commented on issue #9677: Refactor operators and add MKLDNN

2018-02-14 Thread GitBox
pengzhao-intel commented on issue #9677: Refactor operators and add MKLDNN
URL: https://github.com/apache/incubator-mxnet/pull/9677#issuecomment-365822430
 
 
   All comments have been resolved and pass the CI test.
   Thanks, @zheng-da :)
   
   @szha , @cjolivier01 , @marcoabreu please help take a reveiw again and merge 
the 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] juliusshufan commented on a change in pull request #9793: Enable the reporting of cross-entropy or nll loss value when training CNN network using the models defined by example/image-classific

2018-02-14 Thread GitBox
juliusshufan commented on a change in pull request #9793: Enable the reporting 
of cross-entropy or nll loss value when training CNN network using the models 
defined by example/image-classification
URL: https://github.com/apache/incubator-mxnet/pull/9793#discussion_r168378166
 
 

 ##
 File path: example/image-classification/common/fit.py
 ##
 @@ -117,6 +117,8 @@ def add_fit_args(parser):
help='load the model on an epoch using the 
model-load-prefix')
 train.add_argument('--top-k', type=int, default=0,
help='report the top-k accuracy. 0 means no report.')
+train.add_argument('--loss', type=str,
+   help='report the cross-entropy or nll-loss. ce means 
cross-entropy, nll-loss means likelihood loss')
 
 Review comment:
   @piiswrong @cjolivier01 Thanks for all your comments, and sorry for the 
confusion.
   
   Let me try to explain:
   1. My purpose is to report the loss value during training, this is because 
the loss value trends is helpful to monitor the convergence trend.
   2. Per my understanding is, the cross-entropy loss and (negative) likelihood 
loss are most common used for softmax output, and therefore I choose reporting 
either cross-entropy or negative likelihood loss as long as the output layer is 
the softmax.
   
   The current implementation of my PR is add a string-type argument, that is 
the "--loss", and the corresponding type loss will be reported accordingly.
   
   Meanwhile, my understanding to Eric's comment is, it be better to set the 
the argument as a list including all the matching loss type (['ce', 'nll-loss'] 
for softmax), and give the user to decide which loss value will be used. 
   
   May I know which method is acceptable? I'll then update my implementation 
accordingly.
   Thanks for your 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


[incubator-mxnet] branch master updated: fix markdown hyperlink syntax (#9756)

2018-02-14 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 7d4b4c0  fix markdown hyperlink syntax (#9756)
7d4b4c0 is described below

commit 7d4b4c0d6482894eef869fc2923c5083c7081fcf
Author: Rahul Huilgol 
AuthorDate: Wed Feb 14 20:20:46 2018 -0800

fix markdown hyperlink syntax (#9756)

Removed spacing between link and title
---
 docs/faq/security.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/faq/security.md b/docs/faq/security.md
index 09fa22b..0615acd 100644
--- a/docs/faq/security.md
+++ b/docs/faq/security.md
@@ -12,7 +12,7 @@ In particular the following threat-vectors exist when 
training using MXNet:
 It is highly recommended that the following best practices be followed when 
using MXNet:
 
 * Run MXNet with least privilege, i.e. not as root.
-* Run MXNet training jobs inside a secure and isolated environment. If you are 
using a cloud provider like Amazon AWS, running your training job inside a 
[private VPC] (https://aws.amazon.com/vpc/) is a good way to accomplish this. 
Additionally, configure your network security settings so as to only allow 
connections that the cluster nodes require.
+* Run MXNet training jobs inside a secure and isolated environment. If you are 
using a cloud provider like Amazon AWS, running your training job inside a 
[private VPC](https://aws.amazon.com/vpc/) is a good way to accomplish this. 
Additionally, configure your network security settings so as to only allow 
connections that the cluster nodes require.
 * Make sure no unauthorized actors have physical or remote access to the nodes 
participating in MXNet training.
 * During training, one can configure MXNet to periodically save model 
checkpoints. To protect these model checkpoints from unauthorized access, make 
sure the checkpoints are written out to an encrypted storage volume, and have a 
provision to delete checkpoints that are no longer needed.
 * When sharing trained models, or when receiving trained models from other 
parties, ensure that model artifacts are authenticated and integrity protected 
using cryptographic signatures, thus ensuring that the data received comes from 
trusted sources and has not been maliciously (or accidentally) modified in 
transit.
@@ -21,4 +21,4 @@ It is highly recommended that the following best practices be 
followed when usin
 # Deployment Considerations
 The following are not MXNet framework specific threats but are applicable to 
Machine Learning models in general.
 
-* When deploying high-value, proprietary models for inference, care should be 
taken to prevent an adversary from stealing the model. The research paper 
[Stealing Machine Learning Models via Prediction APIs] 
(https://arxiv.org/pdf/1609.02943.pdf) outlines experiments performed to show 
how an attacker can use a prediction API to leak the ML model or construct a 
nearly identical replica. A simple way to thwart such an attack is to not 
expose the prediction probabilities to a high degree of  [...]
+* When deploying high-value, proprietary models for inference, care should be 
taken to prevent an adversary from stealing the model. The research paper 
[Stealing Machine Learning Models via Prediction 
APIs](https://arxiv.org/pdf/1609.02943.pdf) outlines experiments performed to 
show how an attacker can use a prediction API to leak the ML model or construct 
a nearly identical replica. A simple way to thwart such an attack is to not 
expose the prediction probabilities to a high degree of p [...]

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


[GitHub] szha closed pull request #9756: Fix markdown link syntax error

2018-02-14 Thread GitBox
szha closed pull request #9756: Fix markdown link syntax error
URL: https://github.com/apache/incubator-mxnet/pull/9756
 
 
   

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/faq/security.md b/docs/faq/security.md
index 09fa22b7e3..0615acda34 100644
--- a/docs/faq/security.md
+++ b/docs/faq/security.md
@@ -12,7 +12,7 @@ In particular the following threat-vectors exist when 
training using MXNet:
 It is highly recommended that the following best practices be followed when 
using MXNet:
 
 * Run MXNet with least privilege, i.e. not as root.
-* Run MXNet training jobs inside a secure and isolated environment. If you are 
using a cloud provider like Amazon AWS, running your training job inside a 
[private VPC] (https://aws.amazon.com/vpc/) is a good way to accomplish this. 
Additionally, configure your network security settings so as to only allow 
connections that the cluster nodes require.
+* Run MXNet training jobs inside a secure and isolated environment. If you are 
using a cloud provider like Amazon AWS, running your training job inside a 
[private VPC](https://aws.amazon.com/vpc/) is a good way to accomplish this. 
Additionally, configure your network security settings so as to only allow 
connections that the cluster nodes require.
 * Make sure no unauthorized actors have physical or remote access to the nodes 
participating in MXNet training.
 * During training, one can configure MXNet to periodically save model 
checkpoints. To protect these model checkpoints from unauthorized access, make 
sure the checkpoints are written out to an encrypted storage volume, and have a 
provision to delete checkpoints that are no longer needed.
 * When sharing trained models, or when receiving trained models from other 
parties, ensure that model artifacts are authenticated and integrity protected 
using cryptographic signatures, thus ensuring that the data received comes from 
trusted sources and has not been maliciously (or accidentally) modified in 
transit.
@@ -21,4 +21,4 @@ It is highly recommended that the following best practices be 
followed when usin
 # Deployment Considerations
 The following are not MXNet framework specific threats but are applicable to 
Machine Learning models in general.
 
-* When deploying high-value, proprietary models for inference, care should be 
taken to prevent an adversary from stealing the model. The research paper 
[Stealing Machine Learning Models via Prediction APIs] 
(https://arxiv.org/pdf/1609.02943.pdf) outlines experiments performed to show 
how an attacker can use a prediction API to leak the ML model or construct a 
nearly identical replica. A simple way to thwart such an attack is to not 
expose the prediction probabilities to a high degree of precision in the API 
response.
+* When deploying high-value, proprietary models for inference, care should be 
taken to prevent an adversary from stealing the model. The research paper 
[Stealing Machine Learning Models via Prediction 
APIs](https://arxiv.org/pdf/1609.02943.pdf) outlines experiments performed to 
show how an attacker can use a prediction API to leak the ML model or construct 
a nearly identical replica. A simple way to thwart such an attack is to not 
expose the prediction probabilities to a high degree of precision in the API 
response.


 


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 #9772: ndarray indexing issues

2018-02-14 Thread GitBox
anirudh2290 commented on issue #9772: ndarray indexing issues
URL: 
https://github.com/apache/incubator-mxnet/issues/9772#issuecomment-365820033
 
 
   @reminisce away from laptop. Will give that a try. Tried with np.int64 


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] DickJC123 commented on a change in pull request #9791: CI test randomness 3

2018-02-14 Thread GitBox
DickJC123 commented on a change in pull request #9791: CI test randomness 3
URL: https://github.com/apache/incubator-mxnet/pull/9791#discussion_r168376275
 
 

 ##
 File path: tests/python/unittest/test_operator.py
 ##
 @@ -2265,18 +2317,18 @@ def check_instance_norm_with_shape(shape, xpu):
numeric_eps=1e-2, rtol=1e-2, atol=1e-2)
 
 
+@with_seed()
 def test_instance_normalization():
 check_instance_norm_with_shape((1, 1, 1), default_context())
 check_instance_norm_with_shape((2, 1, 2), default_context())
 check_instance_norm_with_shape((2,4,5,6), default_context())
 check_instance_norm_with_shape((3,3,2,3,2,1,1), default_context())
 
 
-def check_l2_normalization(in_shape, mode, ctx=default_context(), 
norm_eps=1e-10):
+def check_l2_normalization(in_shape, mode, norm_eps=1e-10):
+ctx = default_context()
 data = mx.symbol.Variable('data')
 out = mx.symbol.L2Normalization(data=data, mode=mode, eps=norm_eps)
-# TODO(szha): Seeding this masks failures. We need to do a deep dive for 
failures without this seed.
 
 Review comment:
   I moved both the TODO and the seed-setting to the beginning of the test


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] DickJC123 commented on a change in pull request #9791: CI test randomness 3

2018-02-14 Thread GitBox
DickJC123 commented on a change in pull request #9791: CI test randomness 3
URL: https://github.com/apache/incubator-mxnet/pull/9791#discussion_r168376036
 
 

 ##
 File path: tests/python/unittest/test_autograd.py
 ##
 @@ -360,8 +373,12 @@ def backward(self, dm, dn):
 
 assert_almost_equal(x.grad.asnumpy(), dx1)
 assert_almost_equal(y.grad.asnumpy(), dy1)
+#atol = 1e-6
+#assert_almost_equal(x.grad.asnumpy(), dx1, atol=atol)
+#assert_almost_equal(y.grad.asnumpy(), dy1, atol=atol)
 
 Review comment:
   Will do.  My error to leave this in.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on a change in pull request #9790: make array.reshape compatible with numpy

2018-02-14 Thread GitBox
szha commented on a change in pull request #9790: make array.reshape compatible 
with numpy
URL: https://github.com/apache/incubator-mxnet/pull/9790#discussion_r168375961
 
 

 ##
 File path: python/mxnet/ndarray/ndarray.py
 ##
 @@ -968,6 +973,14 @@ def reshape(self, shape):
 array([[-1., -1., -1.],
[-1., -1., -1.]], dtype=float32)
 """
+if len(shape) == 1 and isinstance(shape[0], (list, tuple)):
+shape = shape[0]
+elif not len(shape):
 
 Review comment:
   would that be a problem?


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] DickJC123 commented on a change in pull request #9791: CI test randomness 3

2018-02-14 Thread GitBox
DickJC123 commented on a change in pull request #9791: CI test randomness 3
URL: https://github.com/apache/incubator-mxnet/pull/9791#discussion_r168375948
 
 

 ##
 File path: tests/python/unittest/test_gluon.py
 ##
 @@ -530,13 +562,19 @@ def __init__(self, **kwargs):
 model.collect_params()
 assert len(w) == 0
 
+
+@with_seed()
 def test_sequential_warning():
 with warnings.catch_warnings(record=True) as w:
+# The following line permits the test to pass if run multiple times
+warnings.simplefilter('always')
 
 Review comment:
   This PR provides an easy way to run a test multiple times under different 
seeds.  I found that this particular test would fail under those circumstances 
without this fix, when invoked as:
   
   MXNET_TEST_COUNT=100 nosetests --verbose tests/python/unittest/test_gluon.py


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 #9614: MobileNetV2

2018-02-14 Thread GitBox
szha commented on issue #9614: MobileNetV2
URL: https://github.com/apache/incubator-mxnet/pull/9614#issuecomment-365818872
 
 
   @zhreshold please approve once you confirm that it's implemented correctly.


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 #9614: MobileNetV2

2018-02-14 Thread GitBox
szha commented on issue #9614: MobileNetV2
URL: https://github.com/apache/incubator-mxnet/pull/9614#issuecomment-365818591
 
 
   LGTM. Would you mind adding the variants to 
`tests/python/unittest/test_gluon_model_zoo.py`? Click the unchecked checkbox 
at the top of this PR once you're 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] szha commented on issue #9614: MobileNetV2

2018-02-14 Thread GitBox
szha commented on issue #9614: MobileNetV2
URL: https://github.com/apache/incubator-mxnet/pull/9614#issuecomment-365818591
 
 
   LGTM. Would you mind adding the variants to 
`tests/python/unittest/test_gluon_model_zoo.py`?


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 #9614: MobileNetV2

2018-02-14 Thread GitBox
szha commented on issue #9614: MobileNetV2
URL: https://github.com/apache/incubator-mxnet/pull/9614#issuecomment-365818591
 
 
   Would you mind adding the variants to 
`tests/python/unittest/test_gluon_model_zoo.py`?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] reminisce commented on issue #9772: ndarray indexing issues

2018-02-14 Thread GitBox
reminisce commented on issue #9772: ndarray indexing issues
URL: 
https://github.com/apache/incubator-mxnet/issues/9772#issuecomment-365816759
 
 
   @anirudh2290 Have you tried the following?
   ```python
   Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct  5 2017, 02:28:52) 
   [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import mxnet as mx
   /Users/jwum/anaconda2/lib/python2.7/site-packages/h5py/__init__.py:34: 
FutureWarning: Conversion of the second argument of issubdtype from `float` to 
`np.floating` is deprecated. In future, it will be treated as `np.float64 == 
np.dtype(float).type`.
 from ._conv import register_converters as _register_converters
   
/Users/jwum/anaconda2/lib/python2.7/site-packages/mxnet-1.1.0-py2.7.egg/mxnet/optimizer.py:136:
 UserWarning: WARNING: New optimizer mxnet.optimizer.NAG is overriding existing 
optimizer mxnet.optimizer.NAG
 Optimizer.opt_registry[name].__name__))
   
imp/Users/jwum/anaconda2/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py:46:
 DeprecationWarning: OpenSSL.rand is deprecated - you should use os.urandom 
instead
 import OpenSSL.SSL
   >>> import numpy as np
   >>> a = np.array([0], dtype='int32')
   >>> b = mx.nd.array(a)
   >>> b[a[0]]
   Traceback (most recent call last):
 File "", line 1, in 
 File 
"/Users/jwum/anaconda2/lib/python2.7/site-packages/mxnet-1.1.0-py2.7.egg/mxnet/ndarray/ndarray.py",
 line 504, in __getitem__
   % (str(key), str(type(key
   ValueError: Indexing NDArray with index=0 and type= is 
not supported
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on a change in pull request #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
szha commented on a change in pull request #9777: [MX-9588] Add micro averaging 
strategy for F1 metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#discussion_r168374258
 
 

 ##
 File path: python/mxnet/metric.py
 ##
 @@ -503,21 +582,27 @@ class F1(EvalMetric):
 label_names : list of str, or None
 Name of labels that should be used when updating with update_dict.
 By default include all labels.
+average : str, default 'macro'
+Strategy to be used for aggregating across micro-batches.
+"macro": average the F1 scores for each batch
+"micro": compute a single F1 score across all batches
 
 Review comment:
   Add period at the end. Currently it renders into:
   
http://mxnet-doc.s3-accelerate.dualstack.amazonaws.com/api/python/metric/metric.html#mxnet.metric.F1


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 #9772: ndarray indexing issues

2018-02-14 Thread GitBox
anirudh2290 commented on issue #9772: ndarray indexing issues
URL: 
https://github.com/apache/incubator-mxnet/issues/9772#issuecomment-365816203
 
 
   @reminisce I wasnt able to reproduce the issue for python 2. The int type 
changed in python3 and not related to numpy classes


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on a change in pull request #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
szha commented on a change in pull request #9777: [MX-9588] Add micro averaging 
strategy for F1 metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#discussion_r168373771
 
 

 ##
 File path: python/mxnet/metric.py
 ##
 @@ -503,21 +582,27 @@ class F1(EvalMetric):
 label_names : list of str, or None
 Name of labels that should be used when updating with update_dict.
 By default include all labels.
+average : str, default 'macro'
+Strategy to be used for aggregating across micro-batches.
 
 Review comment:
   "mini-batches" is more commonly used.


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] dwSun commented on issue #9614: MobileNetV2

2018-02-14 Thread GitBox
dwSun commented on issue #9614: MobileNetV2
URL: https://github.com/apache/incubator-mxnet/pull/9614#issuecomment-365812147
 
 
   for reference, this is the struct I am using:
   ```
   input shape stride  output shape
   # conv2d
   224x224x3   2   112x112x32
   
   # bottleneck
   112x112x32  1   112x112x16
   
   # bottleneck
   112x112x16  2   56x56x24
   56x56x241   56x56x24
   
   # bottleneck
   56x56x242   28x28x32
   28x28x321   28x28x32
   28x28x321   28x28x32
   
   # bottleneck
   28x28x321   28x28x64
   28x28x641   28x28x64
   28x28x641   28x28x64
   28x28x641   28x28x64
   
   # bottleneck
   28x28x642   14x14x96
   14x14x961   14x14x96
   14x14x961   14x14x96
   
   # bottleneck
   14x14x962   7x7x160
   7x7x160 1   7x7x160
   7x7x160 1   7x7x160
   
   # bottleneck
   7x7x160 1   7x7x320
   
   # conv2d
   7x7x320 1   7x7x1280
   
   # avgpool
   7x7x1280_   1x1x1280
   
   # the output
   1x1x1280_   1x1xk
   
   ```


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] dwSun commented on a change in pull request #9614: MobileNetV2

2018-02-14 Thread GitBox
dwSun commented on a change in pull request #9614: MobileNetV2
URL: https://github.com/apache/incubator-mxnet/pull/9614#discussion_r168369399
 
 

 ##
 File path: python/mxnet/gluon/model_zoo/vision/mobilenet.py
 ##
 @@ -74,13 +123,69 @@ def hybrid_forward(self, F, x):
 x = self.output(x)
 return x
 
+
+class MobileNetV2(nn.HybridBlock):
+r"""MobileNetV2 model from the
+`"Inverted Residuals and Linear Bottlenecks:
+  Mobile Networks for Classification, Detection and Segmentation"
+`_ paper.
+
+Parameters
+--
+multiplier : float, default 1.0
+The width multiplier for controling the model size. The actual number 
of channels
+is equal to the original channel size multiplied by this multiplier.
+classes : int, default 1000
+Number of classes for the output layer.
+"""
+
+def __init__(self, multiplier=1.0, classes=1000, **kwargs):
+super(MobileNetV2, self).__init__(**kwargs)
+with self.name_scope():
+self.features = nn.HybridSequential(prefix='features_')
+with self.features.name_scope():
+_add_conv(self.features, int(32 * multiplier), kernel=3, 
stride=2, pad=1)
+
+in_channels_group = [int(x * multiplier) for x in [32] + [16] 
+ [24] * 2
+ + [32] * 3 + [64] * 4 + [96] * 3 + [160] 
* 3]
+channels_group = [int(x * multiplier) for x in [16] + [24] * 2 
+ [32] * 3
+  + [64] * 4 + [96] * 3 + [160] * 3 + [320]]
+ts = [1] + [6] * 16
+strides = [1, 2] * 2 + [1] * 2 + [2] + [1] * 3 + [1] * 3 + [2] 
+ [1] * 3
 
 Review comment:
   My mistake. Those 2 lines indeed can't make sense. Will correct it in next 
commit.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] reminisce commented on issue #9743: from tensorboard import SummaryWriter wrong

2018-02-14 Thread GitBox
reminisce commented on issue #9743: from tensorboard import SummaryWriter wrong
URL: 
https://github.com/apache/incubator-mxnet/issues/9743#issuecomment-365809418
 
 
   `tensorboard` has been changed to refer to the TensorFlow's TensorBoard in 
PyPI.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] reminisce commented on issue #9772: ndarray indexing issues

2018-02-14 Thread GitBox
reminisce commented on issue #9772: ndarray indexing issues
URL: 
https://github.com/apache/incubator-mxnet/issues/9772#issuecomment-365808285
 
 
   The problem is that in MXNet, `integer_types` are defined as native python 
integer types: `int` and `long`, while `np.int32` and `np.int64` are different 
classes. That's why `isinstance` check failed. This happens for both python2 
and python3.
   
   @piiswrong Is there any concern of adding `np.int32` and `np.int64` to the 
definition of `integer_types` here?
   
https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/base.py#L40


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 opened a new pull request #9795: Add tests for Exception Handling in Iterators

2018-02-14 Thread GitBox
anirudh2290 opened a new pull request #9795: Add tests for Exception Handling 
in Iterators
URL: https://github.com/apache/incubator-mxnet/pull/9795
 
 
   ## Description ##
   This adds additional tests for exception handling in Iterators. This 
requires the following PR to be merged: 
https://github.com/dmlc/dmlc-core/pull/366
   
   ## Checklist ##
   ### Essentials ###
   - [x] Passed code style checking (`make lint`)
   - [x] Changes are complete (i.e. I finished coding on this PR)
   - [x] 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 ###
   - [x] added test
   
   ## Comments ##
   - Requires https://github.com/dmlc/dmlc-core/pull/366 to be merged to 
dmlc-core.


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 #9699: MXNet pip package installs older version of numpy (1.13)

2018-02-14 Thread GitBox
szha commented on issue #9699: MXNet pip package installs older version of 
numpy (1.13)
URL: 
https://github.com/apache/incubator-mxnet/issues/9699#issuecomment-365793086
 
 
   Does conda allow multiple versions of the same package in the same 
environment?


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] sandeep-krishnamurthy commented on issue #9702: [Post 1.1.0] Apply PR #9701 to the master branch

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9702: [Post 1.1.0] Apply PR #9701 to 
the master branch
URL: 
https://github.com/apache/incubator-mxnet/issues/9702#issuecomment-365789310
 
 
   @mbaijal - Any update on this issue. Can be resolved?


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] sandeep-krishnamurthy commented on issue #9699: MXNet pip package installs older version of numpy (1.13)

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9699: MXNet pip package installs 
older version of numpy (1.13)
URL: 
https://github.com/apache/incubator-mxnet/issues/9699#issuecomment-365789074
 
 
   This issue occurs, when I create a conda environment with numpy and later in 
the environment, I install mxnet via pip. Issue seems to be mxnet pip package 
is not uninstalling and reinstall a different version of Numpy. 


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] sandeep-krishnamurthy closed issue #9750: Any ideas how to implement Z-Buffer algorithm?

2018-02-14 Thread GitBox
sandeep-krishnamurthy closed issue #9750: Any ideas how to implement Z-Buffer 
algorithm?
URL: https://github.com/apache/incubator-mxnet/issues/9750
 
 
   


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] sandeep-krishnamurthy commented on issue #9750: Any ideas how to implement Z-Buffer algorithm?

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9750: Any ideas how to implement 
Z-Buffer algorithm?
URL: 
https://github.com/apache/incubator-mxnet/issues/9750#issuecomment-365788604
 
 
   Resolving here.
   @ShownX as Anirudh mentioned, please ask this query at - 
https://discuss.mxnet.io/


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 #9772: ndarray indexing issues

2018-02-14 Thread GitBox
piiswrong commented on issue #9772: ndarray indexing issues
URL: 
https://github.com/apache/incubator-mxnet/issues/9772#issuecomment-365788276
 
 
   @reminisce 


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] sandeep-krishnamurthy commented on issue #9758: unknown output shape before inference

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9758: unknown output shape before 
inference
URL: 
https://github.com/apache/incubator-mxnet/issues/9758#issuecomment-365787342
 
 
   @cccorn - Asking usability questions at discuss - https://discuss.mxnet.io/ 
will yield faster response.


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] sandeep-krishnamurthy closed issue #9760: How can I pad images using mx.nd.pad?

2018-02-14 Thread GitBox
sandeep-krishnamurthy closed issue #9760: How can I pad images using mx.nd.pad?
URL: https://github.com/apache/incubator-mxnet/issues/9760
 
 
   


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] sandeep-krishnamurthy commented on issue #9760: How can I pad images using mx.nd.pad?

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9760: How can I pad images using 
mx.nd.pad?
URL: 
https://github.com/apache/incubator-mxnet/issues/9760#issuecomment-365786901
 
 
   MXNet supports and is more efficient with channels_first format only. 
   Resolving.
   For usability question, please ask at - https://discuss.mxnet.io/


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] sandeep-krishnamurthy commented on issue #9762: Should MXNet also support logical operations?

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9762: Should MXNet also support 
logical operations?
URL: 
https://github.com/apache/incubator-mxnet/issues/9762#issuecomment-365786530
 
 
   +1
   For logical operators in symbolic interface.


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] sandeep-krishnamurthy commented on issue #9763: Too many header files need to be included when using C++ api

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9763: Too many header files need to 
be included when using C++ api
URL: 
https://github.com/apache/incubator-mxnet/issues/9763#issuecomment-365785982
 
 
   There is discussion started by MXNet community to address this issue. Please 
chime in to provide your inputs and possibly contribute. 
   
   
https://lists.apache.org/thread.html/b8e655ab756db258efb1a5483b1643dbdc8fc0bfc12ce1cb8f1c2837@%3Cdev.mxnet.apache.org%3E


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] sandeep-krishnamurthy closed issue #9764: Large batch size does not improve predict speed

2018-02-14 Thread GitBox
sandeep-krishnamurthy closed issue #9764: Large batch size does not improve 
predict speed
URL: https://github.com/apache/incubator-mxnet/issues/9764
 
 
   


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] sandeep-krishnamurthy commented on issue #9764: Large batch size does not improve predict speed

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9764: Large batch size does not 
improve predict speed
URL: 
https://github.com/apache/incubator-mxnet/issues/9764#issuecomment-365785272
 
 
   Hi @gaosanyuan - I think this question can get answer faster on discuss - 
https://discuss.mxnet.io/latest
   Some related discussion:
   
https://discuss.mxnet.io/t/best-practices-for-prediction-on-a-machine-with-multiple-gpus/192/2
   
https://discuss.mxnet.io/t/forward-pass-performance-for-one-image-is-quite-slow-concerns-mxnet-0-11-0/229
   
   Closing the issue here. Please reopen if the performance degradation is due 
to a 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] arnaghizadeh commented on issue #9765: Installation with GPU on Fedora 27?

2018-02-14 Thread GitBox
arnaghizadeh commented on issue #9765: Installation with GPU on Fedora 27?
URL: 
https://github.com/apache/incubator-mxnet/issues/9765#issuecomment-365784660
 
 
   @sandeep-krishnamurthy I tried that but it did not work in the end I had to 
reinstall the CUDA and NVIDIA driver with a different repository. Nevertheless, 
it seems that the problem is not CUDA 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] sethah commented on a change in pull request #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
sethah commented on a change in pull request #9777: [MX-9588] Add micro 
averaging strategy for F1 metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#discussion_r168348423
 
 

 ##
 File path: python/mxnet/metric.py
 ##
 @@ -475,8 +475,84 @@ def update(self, labels, preds):
 self.num_inst += num_samples
 
 
+class _BinaryClassificationMixin(object):
+"""
+Private mixin for keeping track of TPR, FPR, TNR, FNR counts for a 
classification metric.
+"""
+
+def __init__(self):
+self._true_positives = 0
+self._false_negatives = 0
+self._false_positives = 0
+self._true_negatives = 0
+
+def _update_binary_stats(self, label, pred):
+"""
+Update various binary classification counts for a single (label, pred)
+pair.
+
+Parameters
+--
+label : `NDArray`
+The labels of the data.
+
+pred : `NDArray`
+Predicted values.
+"""
+pred = pred.asnumpy()
+label = label.asnumpy().astype('int32')
+pred_label = numpy.argmax(pred, axis=1)
+
+check_label_shapes(label, pred)
+if len(numpy.unique(label)) > 2:
+raise ValueError("%s currently only supports binary 
classification."
+ % self.__class__.__name__)
+
+for y_pred, y_true in zip(pred_label, label):
+if y_pred == 1 and y_true == 1:
+self._true_positives += 1.
+elif y_pred == 1 and y_true == 0:
+self._false_positives += 1.
+elif y_pred == 0 and y_true == 1:
+self._false_negatives += 1.
+else:
+self._true_negatives += 1.
+
+
+@property
+def _precision(self):
+if self._true_positives + self._false_positives > 0:
+return self._true_positives / (self._true_positives + 
self._false_positives)
+else:
+return 0.
+
+@property
+def _recall(self):
+if self._true_positives + self._false_negatives > 0:
+return self._true_positives / (self._true_positives + 
self._false_negatives)
+else:
+return 0.
+
+@property
+def _fscore(self):
+if self._precision + self._recall > 0:
+return 2 * self._precision * self._recall / (self._precision + 
self._recall)
+else:
+return 0.
+
+@property
+def _total_examples(self):
+return self._false_negatives + self._false_positives + \
+   self._true_negatives + self._true_positives
+
+def _reset_stats(self):
+self._false_positives = 0
+self._false_negatives = 0
+self._true_positives = 0
+self._true_negatives = 0
+
 @register
-class F1(EvalMetric):
+class F1(EvalMetric, _BinaryClassificationMixin):
 
 Review comment:
   Can you check latest commit to see if that's what you had in mind?


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] sandeep-krishnamurthy commented on issue #9765: Installation with GPU on Fedora 27?

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9765: Installation with GPU on Fedora 
27?
URL: 
https://github.com/apache/incubator-mxnet/issues/9765#issuecomment-365783147
 
 
   Hi, if CUDA library path is the issue, did you try compiling by passing the 
CUDA path. Something like below.
   ```
   make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 
USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1
   ```


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] rahul003 commented on issue #9774: mx.io.ImageRecordIter does not respect dtype argument

2018-02-14 Thread GitBox
rahul003 commented on issue #9774: mx.io.ImageRecordIter does not respect dtype 
argument
URL: 
https://github.com/apache/incubator-mxnet/issues/9774#issuecomment-365780748
 
 
   Thanks, this 
[blogpost](http://docs.nvidia.com/deeplearning/sdk/mixed-precision-training/index.html)
 mentions training imagenet with resnet50 on 8 volta gpus. Could you share the 
performance benefits you had observed in such settings? Or under optimal 
conditions, roughly how much speedup did you notice with 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] sandeep-krishnamurthy closed issue #9792: Any versions of NASNet/ShuffleNet models available in mxnet?

2018-02-14 Thread GitBox
sandeep-krishnamurthy closed issue #9792: Any versions of NASNet/ShuffleNet 
models available in mxnet?
URL: https://github.com/apache/incubator-mxnet/issues/9792
 
 
   


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] sandeep-krishnamurthy commented on issue #9792: Any versions of NASNet/ShuffleNet models available in mxnet?

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9792: Any versions of 
NASNet/ShuffleNet models available in mxnet?
URL: 
https://github.com/apache/incubator-mxnet/issues/9792#issuecomment-365781031
 
 
   Hi, For examples and usability questions, please ask at - 
https://discuss.mxnet.io/ 
   
   Resolving 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] rahul003 commented on issue #9774: mx.io.ImageRecordIter does not respect dtype argument

2018-02-14 Thread GitBox
rahul003 commented on issue #9774: mx.io.ImageRecordIter does not respect dtype 
argument
URL: 
https://github.com/apache/incubator-mxnet/issues/9774#issuecomment-365780748
 
 
   Thanks, this 
[blogpost](http://docs.nvidia.com/deeplearning/sdk/mixed-precision-training/index.html)
 mentions training imagenet with resnet50 on 8 volta gpus. Could you share the 
performance benefits you had observed in such settings? A rough speedup factor 
would do.


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] sandeep-krishnamurthy commented on issue #9794: MKL linker error on macOS 10.13 despite using configuration without MKL

2018-02-14 Thread GitBox
sandeep-krishnamurthy commented on issue #9794: MKL linker error on macOS 10.13 
despite using configuration without MKL
URL: 
https://github.com/apache/incubator-mxnet/issues/9794#issuecomment-365780663
 
 
   Hi,
   
   * Issue looks similar to 
https://github.com/apache/incubator-mxnet/issues/3743 and 
https://github.com/apache/incubator-mxnet/issues/2027 where the root cause 
found to be OpenCV installation issue. 
   * Can you please provide full error message?
   * There are pre-built pip packages for MacOS Python users. 
http://mxnet.incubator.apache.org/install/index.html 
   You can use "--pre" option in pip command to get latest nightly build.


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] ptrendx commented on issue #9774: mx.io.ImageRecordIter does not respect dtype argument

2018-02-14 Thread GitBox
ptrendx commented on issue #9774: mx.io.ImageRecordIter does not respect dtype 
argument
URL: 
https://github.com/apache/incubator-mxnet/issues/9774#issuecomment-365780010
 
 
   There are few possible explanations.
   The most probable reason is workspace size for convolutions. I tried 
pitching @piiswrong to change the default MXNet's behavior of limiting the 
results of cudnnFind to the ones fitting the workspace, but did not have luck 
with that. Try with MXNET_CUDNN_AUTOTUNE_DEFAULT = 2. 
   Also if you tried benchmarking with real data, make sure you are not limited 
by the IO (you may need to set --data-nthreads to something more than the 
default 4).
   And finally, depthwise convolutions in networks like resnext do not 
currently benefit much from TensorCore, so if that is what you tested, then 
benefit should be small.


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] rahul003 commented on issue #9774: mx.io.ImageRecordIter does not respect dtype argument

2018-02-14 Thread GitBox
rahul003 commented on issue #9774: mx.io.ImageRecordIter does not respect dtype 
argument
URL: 
https://github.com/apache/incubator-mxnet/issues/9774#issuecomment-365769322
 
 
   Thanks for the explanation. 
   
   Btw, is training in fp16 supposed to be ~2x faster than fp32 for a given 
batch size? Or is this only about reduced memory usage so we can use larger 
batch sizes. I have run the examples you had added for fp16 in image 
classification, and I see maybe +- 10-15% speed changes, nowhere close to 2x 
for a given batch size. Is this normal?
   
   I ran these tests on p3.8x and p3.16x EC2 machines, which use the Volta 
range of GPUs. I have CUDA9 as well.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rahul003 commented on issue #9774: mx.io.ImageRecordIter does not respect dtype argument

2018-02-14 Thread GitBox
rahul003 commented on issue #9774: mx.io.ImageRecordIter does not respect dtype 
argument
URL: 
https://github.com/apache/incubator-mxnet/issues/9774#issuecomment-365769322
 
 
   Thanks for the explanation. 
   
   Btw, is training in fp16 supposed to be ~2x faster than fp32 for a given 
batch size? Or is this only about reduced memory usage so we can use larger 
batch sizes. I have run the examples you had added for fp16 in image 
classification, and I see maybe +- 10-15% speed changes, nowhere close to 2x 
for a given batch size. Is this normal?
   
   I ran these tests on p3.8x and p3.16x EC2 machines, which use the Volta 
range of GPUs. I have CUDA9 as well. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] rahul003 commented on issue #9774: mx.io.ImageRecordIter does not respect dtype argument

2018-02-14 Thread GitBox
rahul003 commented on issue #9774: mx.io.ImageRecordIter does not respect dtype 
argument
URL: 
https://github.com/apache/incubator-mxnet/issues/9774#issuecomment-365769322
 
 
   Thanks for the explanation. 
   
   Btw, is training in fp16 supposed to be ~2x faster than fp32 for a given 
batch size? Or is this only about reduced memory usage so we can use larger 
batch sizes. I have run the examples you had added for fp16 in image 
classification, and I see maybe +- 10-15% speed changes, nowhere close to 2x 
for a given batch size. Is this normal?


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] zheng-da commented on issue #9677: Refactor operators and add MKLDNN

2018-02-14 Thread GitBox
zheng-da commented on issue #9677: Refactor operators and add MKLDNN
URL: https://github.com/apache/incubator-mxnet/pull/9677#issuecomment-365764910
 
 
   @marcoabreu the requests have been fixed. can you approve 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] cjolivier01 commented on a change in pull request #9793: Enable the reporting of cross-entropy or nll loss value when training CNN network using the models defined by example/image-classifica

2018-02-14 Thread GitBox
cjolivier01 commented on a change in pull request #9793: Enable the reporting 
of cross-entropy or nll loss value when training CNN network using the models 
defined by example/image-classification
URL: https://github.com/apache/incubator-mxnet/pull/9793#discussion_r168325934
 
 

 ##
 File path: example/image-classification/common/fit.py
 ##
 @@ -117,6 +117,8 @@ def add_fit_args(parser):
help='load the model on an epoch using the 
model-load-prefix')
 train.add_argument('--top-k', type=int, default=0,
help='report the top-k accuracy. 0 means no report.')
+train.add_argument('--loss', type=str,
+   help='report the cross-entropy or nll-loss. ce means 
cross-entropy, nll-loss means likelihood loss')
 
 Review comment:
   This seems a little confusing to me, as in what's the actual expected loss 
string.
   Maybe something like:
   "report the loss. Options are ce (cross-entropy) or nll-loss (likelihood 
loss)
   ?


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 #9793: Enable the reporting of cross-entropy or nll loss value when training CNN network using the models defined by example/image-classifica

2018-02-14 Thread GitBox
cjolivier01 commented on a change in pull request #9793: Enable the reporting 
of cross-entropy or nll loss value when training CNN network using the models 
defined by example/image-classification
URL: https://github.com/apache/incubator-mxnet/pull/9793#discussion_r168324964
 
 

 ##
 File path: example/image-classification/common/fit.py
 ##
 @@ -260,6 +262,18 @@ def fit(args, network, data_loader, **kwargs):
 eval_metrics.append(mx.metric.create(
 'top_k_accuracy', top_k=args.top_k))
 
+supported_loss = ['ce', 'nll_loss']
+if args.loss:
 
 Review comment:
   would len(args.loss) > 0 or come other non-implied boolean test read more 
easily?


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 #9793: Enable the reporting of cross-entropy or nll loss value when training CNN network using the models defined by example/image-classifica

2018-02-14 Thread GitBox
cjolivier01 commented on a change in pull request #9793: Enable the reporting 
of cross-entropy or nll loss value when training CNN network using the models 
defined by example/image-classification
URL: https://github.com/apache/incubator-mxnet/pull/9793#discussion_r168325934
 
 

 ##
 File path: example/image-classification/common/fit.py
 ##
 @@ -117,6 +117,8 @@ def add_fit_args(parser):
help='load the model on an epoch using the 
model-load-prefix')
 train.add_argument('--top-k', type=int, default=0,
help='report the top-k accuracy. 0 means no report.')
+train.add_argument('--loss', type=str,
+   help='report the cross-entropy or nll-loss. ce means 
cross-entropy, nll-loss means likelihood loss')
 
 Review comment:
   This seems a little confusing to me, as in what's the actual expected loss 
string.
   Maybe something like:
   "report the loss. Options are ce (cross-entropy) or nll-loss (likelihood 
loss)
   ?
   
   ?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on a change in pull request #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
szha commented on a change in pull request #9777: [MX-9588] Add micro averaging 
strategy for F1 metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#discussion_r168324990
 
 

 ##
 File path: python/mxnet/metric.py
 ##
 @@ -475,8 +475,84 @@ def update(self, labels, preds):
 self.num_inst += num_samples
 
 
+class _BinaryClassificationMixin(object):
+"""
+Private mixin for keeping track of TPR, FPR, TNR, FNR counts for a 
classification metric.
+"""
+
+def __init__(self):
+self._true_positives = 0
+self._false_negatives = 0
+self._false_positives = 0
+self._true_negatives = 0
+
+def _update_binary_stats(self, label, pred):
+"""
+Update various binary classification counts for a single (label, pred)
+pair.
+
+Parameters
+--
+label : `NDArray`
+The labels of the data.
+
+pred : `NDArray`
+Predicted values.
+"""
+pred = pred.asnumpy()
+label = label.asnumpy().astype('int32')
+pred_label = numpy.argmax(pred, axis=1)
+
+check_label_shapes(label, pred)
+if len(numpy.unique(label)) > 2:
+raise ValueError("%s currently only supports binary 
classification."
+ % self.__class__.__name__)
+
+for y_pred, y_true in zip(pred_label, label):
+if y_pred == 1 and y_true == 1:
+self._true_positives += 1.
+elif y_pred == 1 and y_true == 0:
+self._false_positives += 1.
+elif y_pred == 0 and y_true == 1:
+self._false_negatives += 1.
+else:
+self._true_negatives += 1.
+
+
+@property
+def _precision(self):
+if self._true_positives + self._false_positives > 0:
+return self._true_positives / (self._true_positives + 
self._false_positives)
+else:
+return 0.
+
+@property
+def _recall(self):
+if self._true_positives + self._false_negatives > 0:
+return self._true_positives / (self._true_positives + 
self._false_negatives)
+else:
+return 0.
+
+@property
+def _fscore(self):
+if self._precision + self._recall > 0:
+return 2 * self._precision * self._recall / (self._precision + 
self._recall)
+else:
+return 0.
+
+@property
+def _total_examples(self):
+return self._false_negatives + self._false_positives + \
+   self._true_negatives + self._true_positives
+
+def _reset_stats(self):
+self._false_positives = 0
+self._false_negatives = 0
+self._true_positives = 0
+self._true_negatives = 0
+
 @register
-class F1(EvalMetric):
+class F1(EvalMetric, _BinaryClassificationMixin):
 
 Review comment:
   Composition is equally flexible with the drawback of extra dereference, 
though I'm fine either way.


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 #9018: Seg Fault on MNIST example - C++

2018-02-14 Thread GitBox
marcoabreu commented on issue #9018: Seg Fault on MNIST example - C++
URL: 
https://github.com/apache/incubator-mxnet/issues/9018#issuecomment-365755507
 
 
   I'm afraid I can't be of help 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] marcoabreu commented on issue #9018: Seg Fault on MNIST example - C++

2018-02-14 Thread GitBox
marcoabreu commented on issue #9018: Seg Fault on MNIST example - C++
URL: 
https://github.com/apache/incubator-mxnet/issues/9018#issuecomment-365755507
 
 
   I'm afraid I can't be of help 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] szha commented on a change in pull request #9492: fix print_summary bug and add groups of convolution

2018-02-14 Thread GitBox
szha commented on a change in pull request #9492: fix print_summary bug and add 
groups of convolution
URL: https://github.com/apache/incubator-mxnet/pull/9492#discussion_r168318967
 
 

 ##
 File path: python/mxnet/visualization.py
 ##
 @@ -134,20 +134,26 @@ def print_layer_summary(node, out_shape):
 pre_filter = pre_filter + int(shape[0])
 cur_param = 0
 if op == 'Convolution':
-if ("no_bias" in node["attrs"]) and int(node["attrs"]["no_bias"]):
-cur_param = pre_filter * int(node["attrs"]["num_filter"])
+if "no_bias" in node["attrs"] and node["attrs"]["no_bias"] == 
'True':
+num_group = int(node["attrs"]["num_group"]) if \
+   "num_group" in node["attrs"] else 1
 
 Review comment:
   int(node['attrs'].get('num_group', '1')). same below.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on a change in pull request #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
szha commented on a change in pull request #9777: [MX-9588] Add micro averaging 
strategy for F1 metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#discussion_r168317776
 
 

 ##
 File path: python/mxnet/metric.py
 ##
 @@ -475,8 +475,84 @@ def update(self, labels, preds):
 self.num_inst += num_samples
 
 
+class _BinaryClassificationMixin(object):
+"""
+Private mixin for keeping track of TPR, FPR, TNR, FNR counts for a 
classification metric.
+"""
+
+def __init__(self):
+self._true_positives = 0
+self._false_negatives = 0
+self._false_positives = 0
+self._true_negatives = 0
+
+def _update_binary_stats(self, label, pred):
+"""
+Update various binary classification counts for a single (label, pred)
+pair.
+
+Parameters
+--
+label : `NDArray`
+The labels of the data.
+
+pred : `NDArray`
+Predicted values.
+"""
+pred = pred.asnumpy()
+label = label.asnumpy().astype('int32')
+pred_label = numpy.argmax(pred, axis=1)
+
+check_label_shapes(label, pred)
+if len(numpy.unique(label)) > 2:
+raise ValueError("%s currently only supports binary 
classification."
+ % self.__class__.__name__)
+
+for y_pred, y_true in zip(pred_label, label):
+if y_pred == 1 and y_true == 1:
+self._true_positives += 1.
+elif y_pred == 1 and y_true == 0:
+self._false_positives += 1.
+elif y_pred == 0 and y_true == 1:
+self._false_negatives += 1.
+else:
+self._true_negatives += 1.
+
+
+@property
+def _precision(self):
+if self._true_positives + self._false_positives > 0:
+return self._true_positives / (self._true_positives + 
self._false_positives)
+else:
+return 0.
+
+@property
+def _recall(self):
+if self._true_positives + self._false_negatives > 0:
+return self._true_positives / (self._true_positives + 
self._false_negatives)
+else:
+return 0.
+
+@property
+def _fscore(self):
+if self._precision + self._recall > 0:
+return 2 * self._precision * self._recall / (self._precision + 
self._recall)
+else:
+return 0.
+
+@property
+def _total_examples(self):
+return self._false_negatives + self._false_positives + \
+   self._true_negatives + self._true_positives
+
+def _reset_stats(self):
+self._false_positives = 0
+self._false_negatives = 0
+self._true_positives = 0
+self._true_negatives = 0
+
 @register
-class F1(EvalMetric):
+class F1(EvalMetric, _BinaryClassificationMixin):
 
 Review comment:
   Honestly, the current multiple inheritance seems reasonable, in that 
calculating counts and keeping counts are two separate concerns. Mixins is more 
flexible and likely require less code when we extend these to 
multi-class/multi-label/top-k use 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


[GitHub] szha commented on a change in pull request #9790: make array.reshape compatible with numpy

2018-02-14 Thread GitBox
szha commented on a change in pull request #9790: make array.reshape compatible 
with numpy
URL: https://github.com/apache/incubator-mxnet/pull/9790#discussion_r168315437
 
 

 ##
 File path: python/mxnet/ndarray/ndarray.py
 ##
 @@ -968,6 +973,14 @@ def reshape(self, shape):
 array([[-1., -1., -1.],
[-1., -1., -1.]], dtype=float32)
 """
+if len(shape) == 1 and isinstance(shape[0], (list, tuple)):
+shape = shape[0]
+elif not len(shape):
 
 Review comment:
   keyword argument is ignored.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] szha commented on a change in pull request #9790: make array.reshape compatible with numpy

2018-02-14 Thread GitBox
szha commented on a change in pull request #9790: make array.reshape compatible 
with numpy
URL: https://github.com/apache/incubator-mxnet/pull/9790#discussion_r168315361
 
 

 ##
 File path: python/mxnet/ndarray/ndarray.py
 ##
 @@ -926,12 +926,12 @@ def _at(self, idx):
 self.handle, mx_uint(idx), ctypes.byref(handle)))
 return NDArray(handle=handle, writable=self.writable)
 
-def reshape(self, shape):
+def reshape(self, *shape, **kwargs):
 
 Review comment:
   This doesn't work in py2


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 issue #9784: Fix for the case where there are no detections

2018-02-14 Thread GitBox
cjolivier01 commented on issue #9784: Fix for the case where there are no 
detections
URL: https://github.com/apache/incubator-mxnet/pull/9784#issuecomment-365740723
 
 
   Is there a class somewhere with 'CLASS" defined as something other than zero?


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 issue #9784: Fix for the case where there are no detections

2018-02-14 Thread GitBox
cjolivier01 commented on issue #9784: Fix for the case where there are no 
detections
URL: https://github.com/apache/incubator-mxnet/pull/9784#issuecomment-365740723
 
 
   Is there a class somewhere with 'class_idx" defined as something other than 
zero?


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] katrinleinweber opened a new pull request #9318: simplify import of citation metadata

2018-02-14 Thread GitBox
katrinleinweber opened a new pull request #9318: simplify import of citation 
metadata
URL: https://github.com/apache/incubator-mxnet/pull/9318
 
 
   This is a copy of the BibTeX snippet from https://arxiv.org/abs/1512.01274 
incorporated into the repo as suggested in 
https://www.software.ac.uk/blog/2013-09-02-encouraging-citation-software-introducing-citation-files.
 Adding it here may make it simpler for people to cite your software. How about 
it?
   
   Also, it would be possible edit this PR to:
   
   - [ ] use `@software{...`, even though it's may still be treated as `@misc` 
by BibLaTeX
   - [ ] add a DOI through https://guides.github.com/activities/citable-code/
   - [ ] point [`Reference 
Paper`](https://github.com/apache/incubator-mxnet#reference-paper) to this file
   
   I'm leaving out the rest of the checklist from the PR template, because this 
PR does not add our change actual code.


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 #9318: simplify import of citation metadata

2018-02-14 Thread GitBox
piiswrong closed pull request #9318: simplify import of citation metadata
URL: https://github.com/apache/incubator-mxnet/pull/9318
 
 
   

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/CITATION b/CITATION
new file mode 100644
index 00..38ebdde242
--- /dev/null
+++ b/CITATION
@@ -0,0 +1,23 @@
+@article{DBLP:journals/corr/ChenLLLWWXXZZ15,
+  author= {Tianqi Chen and
+   Mu Li and
+   Yutian Li and
+   Min Lin and
+   Naiyan Wang and
+   Minjie Wang and
+   Tianjun Xiao and
+   Bing Xu and
+   Chiyuan Zhang and
+   Zheng Zhang},
+  title = {MXNet: {A} Flexible and Efficient Machine Learning Library for 
Heterogeneous
+   Distributed Systems},
+  journal   = {CoRR},
+  volume= {abs/1512.01274},
+  year  = {2015},
+  url   = {http://arxiv.org/abs/1512.01274},
+  archivePrefix = {arXiv},
+  eprint= {1512.01274},
+  timestamp = {Wed, 07 Jun 2017 14:40:48 +0200},
+  biburl= {http://dblp.org/rec/bib/journals/corr/ChenLLLWWXXZZ15},
+  bibsource = {dblp computer science bibliography, http://dblp.org}
+}


 


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 #9029: Update ndarray binary ops to use kernel launch instead of mshadow operations

2018-02-14 Thread GitBox
piiswrong commented on issue #9029: Update ndarray binary ops to use kernel 
launch instead of mshadow operations
URL: https://github.com/apache/incubator-mxnet/pull/9029#issuecomment-365736266
 
 
   @rahul003 ping


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 #9492: fix print_summary bug and add groups of convolution

2018-02-14 Thread GitBox
piiswrong commented on a change in pull request #9492: fix print_summary bug 
and add groups of convolution
URL: https://github.com/apache/incubator-mxnet/pull/9492#discussion_r168301264
 
 

 ##
 File path: python/mxnet/visualization.py
 ##
 @@ -134,17 +134,23 @@ def print_layer_summary(node, out_shape):
 pre_filter = pre_filter + int(shape[0])
 cur_param = 0
 if op == 'Convolution':
-if ("no_bias" in node["attrs"]) and int(node["attrs"]["no_bias"]):
-cur_param = pre_filter * int(node["attrs"]["num_filter"])
+if ("no_bias" in node["attrs"]) and node["attrs"]["no_bias"] == 
'True':
+num_group = int(node["attrs"]["num_group"]) if \
+   ("num_group" in node["attrs"]) else 1
+cur_param = (pre_filter * int(node["attrs"]["num_filter"])) \
+   // num_group
 for k in _str2tuple(node["attrs"]["kernel"]):
 cur_param *= int(k)
 else:
-cur_param = pre_filter * int(node["attrs"]["num_filter"])
+num_group = int(node["attrs"]["num_group"]) if \
+   ("num_group" in node["attrs"]) else 1
+cur_param = (pre_filter * int(node["attrs"]["num_filter"])) \
+   // num_group
 for k in _str2tuple(node["attrs"]["kernel"]):
 cur_param *= int(k)
 cur_param += int(node["attrs"]["num_filter"])
 elif op == 'FullyConnected':
-if ("no_bias" in node["attrs"]) and int(node["attrs"]["no_bias"]):
+if ("no_bias" in node["attrs"]) and node["attrs"]["no_bias"] == 
'True':
 
 Review comment:
   no. there is compatibility issue


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 #9688: Adapt operators from PyTorch, will keep adding

2018-02-14 Thread GitBox
piiswrong commented on issue #9688: Adapt operators from PyTorch, will keep 
adding
URL: https://github.com/apache/incubator-mxnet/pull/9688#issuecomment-365733960
 
 
   I think its more appropriate to call the BilinearResize


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 #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
piiswrong commented on a change in pull request #9777: [MX-9588] Add micro 
averaging strategy for F1 metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#discussion_r168295625
 
 

 ##
 File path: python/mxnet/metric.py
 ##
 @@ -475,8 +475,84 @@ def update(self, labels, preds):
 self.num_inst += num_samples
 
 
+class _BinaryClassificationMixin(object):
+"""
+Private mixin for keeping track of TPR, FPR, TNR, FNR counts for a 
classification metric.
+"""
+
+def __init__(self):
+self._true_positives = 0
+self._false_negatives = 0
+self._false_positives = 0
+self._true_negatives = 0
+
+def _update_binary_stats(self, label, pred):
+"""
+Update various binary classification counts for a single (label, pred)
+pair.
+
+Parameters
+--
+label : `NDArray`
+The labels of the data.
+
+pred : `NDArray`
+Predicted values.
+"""
+pred = pred.asnumpy()
+label = label.asnumpy().astype('int32')
+pred_label = numpy.argmax(pred, axis=1)
+
+check_label_shapes(label, pred)
+if len(numpy.unique(label)) > 2:
+raise ValueError("%s currently only supports binary 
classification."
+ % self.__class__.__name__)
+
+for y_pred, y_true in zip(pred_label, label):
+if y_pred == 1 and y_true == 1:
+self._true_positives += 1.
+elif y_pred == 1 and y_true == 0:
+self._false_positives += 1.
+elif y_pred == 0 and y_true == 1:
+self._false_negatives += 1.
+else:
+self._true_negatives += 1.
+
+
+@property
+def _precision(self):
+if self._true_positives + self._false_positives > 0:
+return self._true_positives / (self._true_positives + 
self._false_positives)
+else:
+return 0.
+
+@property
+def _recall(self):
+if self._true_positives + self._false_negatives > 0:
+return self._true_positives / (self._true_positives + 
self._false_negatives)
+else:
+return 0.
+
+@property
+def _fscore(self):
+if self._precision + self._recall > 0:
+return 2 * self._precision * self._recall / (self._precision + 
self._recall)
+else:
+return 0.
+
+@property
+def _total_examples(self):
+return self._false_negatives + self._false_positives + \
+   self._true_negatives + self._true_positives
+
+def _reset_stats(self):
+self._false_positives = 0
+self._false_negatives = 0
+self._true_positives = 0
+self._true_negatives = 0
+
 @register
-class F1(EvalMetric):
+class F1(EvalMetric, _BinaryClassificationMixin):
 
 Review comment:
   composition is also possible


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 #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
piiswrong commented on a change in pull request #9777: [MX-9588] Add micro 
averaging strategy for F1 metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#discussion_r168295539
 
 

 ##
 File path: python/mxnet/metric.py
 ##
 @@ -475,8 +475,84 @@ def update(self, labels, preds):
 self.num_inst += num_samples
 
 
+class _BinaryClassificationMixin(object):
+"""
+Private mixin for keeping track of TPR, FPR, TNR, FNR counts for a 
classification metric.
+"""
+
+def __init__(self):
+self._true_positives = 0
+self._false_negatives = 0
+self._false_positives = 0
+self._true_negatives = 0
+
+def _update_binary_stats(self, label, pred):
+"""
+Update various binary classification counts for a single (label, pred)
+pair.
+
+Parameters
+--
+label : `NDArray`
+The labels of the data.
+
+pred : `NDArray`
+Predicted values.
+"""
+pred = pred.asnumpy()
+label = label.asnumpy().astype('int32')
+pred_label = numpy.argmax(pred, axis=1)
+
+check_label_shapes(label, pred)
+if len(numpy.unique(label)) > 2:
+raise ValueError("%s currently only supports binary 
classification."
+ % self.__class__.__name__)
+
+for y_pred, y_true in zip(pred_label, label):
+if y_pred == 1 and y_true == 1:
+self._true_positives += 1.
+elif y_pred == 1 and y_true == 0:
+self._false_positives += 1.
+elif y_pred == 0 and y_true == 1:
+self._false_negatives += 1.
+else:
+self._true_negatives += 1.
+
+
+@property
+def _precision(self):
+if self._true_positives + self._false_positives > 0:
+return self._true_positives / (self._true_positives + 
self._false_positives)
+else:
+return 0.
+
+@property
+def _recall(self):
+if self._true_positives + self._false_negatives > 0:
+return self._true_positives / (self._true_positives + 
self._false_negatives)
+else:
+return 0.
+
+@property
+def _fscore(self):
+if self._precision + self._recall > 0:
+return 2 * self._precision * self._recall / (self._precision + 
self._recall)
+else:
+return 0.
+
+@property
+def _total_examples(self):
+return self._false_negatives + self._false_positives + \
+   self._true_negatives + self._true_positives
+
+def _reset_stats(self):
+self._false_positives = 0
+self._false_negatives = 0
+self._true_positives = 0
+self._true_negatives = 0
+
 @register
-class F1(EvalMetric):
+class F1(EvalMetric, _BinaryClassificationMixin):
 
 Review comment:
   multiple inheritance is very rarely necessary.
   In this case I think _BinaryClassificationMixin should either inherit 
EvalMetric or be refactored into a few utility functions


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 #9790: make array.reshape compatible with numpy

2018-02-14 Thread GitBox
piiswrong commented on a change in pull request #9790: make array.reshape 
compatible with numpy
URL: https://github.com/apache/incubator-mxnet/pull/9790#discussion_r168293562
 
 

 ##
 File path: python/mxnet/ndarray/ndarray.py
 ##
 @@ -968,6 +973,14 @@ def reshape(self, shape):
 array([[-1., -1., -1.],
[-1., -1., -1.]], dtype=float32)
 """
+if len(shape) == 1 and isinstance(shape[0], (list, tuple)):
+shape = shape[0]
+elif not len(shape):
 
 Review comment:
   what happens for reshape(1, 2, shape=1)?


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 #9790: make array.reshape compatible with numpy

2018-02-14 Thread GitBox
piiswrong commented on a change in pull request #9790: make array.reshape 
compatible with numpy
URL: https://github.com/apache/incubator-mxnet/pull/9790#discussion_r168293201
 
 

 ##
 File path: python/mxnet/ndarray/ndarray.py
 ##
 @@ -926,12 +926,12 @@ def _at(self, idx):
 self.handle, mx_uint(idx), ctypes.byref(handle)))
 return NDArray(handle=handle, writable=self.writable)
 
-def reshape(self, shape):
+def reshape(self, *shape, **kwargs):
 
 Review comment:
   (self, *args, shape=None)?


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 a change in pull request #9784: Fix for the case where there are no detections

2018-02-14 Thread GitBox
zhreshold commented on a change in pull request #9784: Fix for the case where 
there are no detections
URL: https://github.com/apache/incubator-mxnet/pull/9784#discussion_r168291198
 
 

 ##
 File path: example/ssd/detect/detector.py
 ##
 @@ -136,31 +132,52 @@ class names
 height = img.shape[0]
 width = img.shape[1]
 colors = dict()
-for i in range(dets.shape[0]):
-cls_id = int(dets[i, 0])
-if cls_id >= 0:
-score = dets[i, 1]
-if score > thresh:
-if cls_id not in colors:
-colors[cls_id] = (random.random(), random.random(), 
random.random())
-xmin = int(dets[i, 2] * width)
-ymin = int(dets[i, 3] * height)
-xmax = int(dets[i, 4] * width)
-ymax = int(dets[i, 5] * height)
-rect = plt.Rectangle((xmin, ymin), xmax - xmin,
- ymax - ymin, fill=False,
- edgecolor=colors[cls_id],
- linewidth=3.5)
-plt.gca().add_patch(rect)
-class_name = str(cls_id)
-if classes and len(classes) > cls_id:
-class_name = classes[cls_id]
-plt.gca().text(xmin, ymin - 2,
-'{:s} {:.3f}'.format(class_name, score),
-bbox=dict(facecolor=colors[cls_id], 
alpha=0.5),
+for det in dets:
+(klass, score, x0, y0, x1, y1) = det
+if score < thresh:
+continue
+cls_id = int(klass)
+if cls_id not in colors:
+colors[cls_id] = (random.random(), random.random(), 
random.random())
+xmin = int(x0 * width)
+ymin = int(y0 * height)
+xmax = int(x1 * width)
+ymax = int(y1 * height)
+rect = plt.Rectangle((xmin, ymin), xmax - xmin,
+ ymax - ymin, fill=False,
+ edgecolor=colors[cls_id],
+ linewidth=3.5)
+plt.gca().add_patch(rect)
+class_name = str(cls_id)
+if classes and len(classes) > cls_id:
+class_name = classes[cls_id]
+plt.gca().text(xmin, ymin - 2,
+'{:s} {:.3f}'.format(class_name, score),
+bbox=dict(facecolor=colors[cls_id], alpha=0.5),
 fontsize=12, color='white')
 plt.show()
 
+@staticmethod
+def filter_positive_detections(detections):
+"""
+First column (class id) is -1 for negative detections
+:param detections:
+:return:
+"""
+class_idx = 0
+assert(isinstance(detections, mx.nd.NDArray) or isinstance(detections, 
np.ndarray))
+detections_per_image = []
+# for each image
+for i in range(detections.shape[0]):
+result = []
+det = detections[i, :, :]
+for obj in det:
+if obj[class_idx] >= 0:
 
 Review comment:
   How about self.class_idx with default 0 in `__init__`


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 #9793: Enable the reporting of cross-entropy or nll loss value when training CNN network using the models defined by example/image-classification

2018-02-14 Thread GitBox
piiswrong commented on issue #9793: Enable the reporting of cross-entropy or 
nll loss value when training CNN network using the models defined by 
example/image-classification
URL: https://github.com/apache/incubator-mxnet/pull/9793#issuecomment-365717847
 
 
   This seems too ad-hoc. Its better to allow the user to select which losses 
they want to see one by one with a single option. Like `--loss=acc,nll,ce...`


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] safrooze closed issue #9213: Crash when MXNet API called before spawning multiprocess

2018-02-14 Thread GitBox
safrooze closed issue #9213: Crash when MXNet API called before spawning 
multiprocess
URL: https://github.com/apache/incubator-mxnet/issues/9213
 
 
   


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] safrooze commented on issue #9213: Crash when MXNet API called before spawning multiprocess

2018-02-14 Thread GitBox
safrooze commented on issue #9213: Crash when MXNet API called before spawning 
multiprocess
URL: 
https://github.com/apache/incubator-mxnet/issues/9213#issuecomment-365717182
 
 
   I confirm that this issue is fixed as of 1.0.0.post1 release.


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] DavoFranco commented on issue #8921: windows7::can not stop mxnet process

2018-02-14 Thread GitBox
DavoFranco commented on issue #8921: windows7::can not stop mxnet process 
URL: 
https://github.com/apache/incubator-mxnet/issues/8921#issuecomment-365716835
 
 
   same error on Windows...using anaconda...it is weird because it was working 
a few days ago
   


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] sethah commented on a change in pull request #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
sethah commented on a change in pull request #9777: [MX-9588] Add micro 
averaging strategy for F1 metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#discussion_r168281425
 
 

 ##
 File path: tests/python/unittest/test_metric.py
 ##
 @@ -56,18 +55,51 @@ def test_acc():
 assert acc == expected_acc
 
 def test_f1():
-pred = mx.nd.array([[0.3, 0.7], [1., 0], [0.4, 0.6], [0.6, 0.4], [0.9, 
0.1]])
-label = mx.nd.array([0, 1, 1, 1, 1])
-positives = np.argmax(pred, axis=1).sum().asscalar()
-true_positives = (np.argmax(pred, axis=1) == label).sum().asscalar()
-precision = true_positives / positives
-overall_positives = label.sum().asscalar()
-recall = true_positives / overall_positives
-f1_expected = 2 * (precision * recall) / (precision + recall)
-metric = mx.metric.create('f1')
-metric.update([label], [pred])
-_, f1 = metric.get()
-assert f1 == f1_expected
+microF1 = mx.metric.create("f1", average="micro")
+macroF1 = mx.metric.F1(average="macro")
+
+assert np.isnan(macroF1.get()[1])
+assert np.isnan(microF1.get()[1])
+
+# check divide by zero
+pred = mx.nd.array([[0.9, 0.1],
+[0.8, 0.2]])
+label = mx.nd.array([0, 0])
+macroF1.update([label], [pred])
+microF1.update([label], [pred])
+assert macroF1.get()[1] == 0.0
+assert microF1.get()[1] == 0.0
+macroF1.reset()
+microF1.reset()
+
+pred11 = mx.nd.array([[0.1, 0.9],
+  [0.5, 0.5]])
+label11 = mx.nd.array([1, 0])
+pred12 = mx.nd.array([[0.85, 0.15],
+  [1.0, 0.0]])
+label12 = mx.nd.array([1, 0])
+pred21 = mx.nd.array([[0.6, 0.4]])
+label21 = mx.nd.array([0])
+pred22 = mx.nd.array([[0.2, 0.8]])
+label22 = mx.nd.array([1])
+
+microF1.update([label11, label12], [pred11, pred12])
+macroF1.update([label11, label12], [pred11, pred12])
+assert microF1.num_inst == 4
+assert macroF1.num_inst == 1
+# f1 = 2 * tp / (2 * tp + fp + fn)
+fscore1 = 2. * (1) / (2 * 1 + 1 + 0)
+np.testing.assert_almost_equal(microF1.get()[1], fscore1)
+np.testing.assert_almost_equal(macroF1.get()[1], fscore1)
+
+microF1.update([label21, label22], [pred21, pred22])
+macroF1.update([label21, label22], [pred21, pred22])
+assert microF1.num_inst == 6
+assert macroF1.num_inst == 2
+fscore2 = 2. * (1) / (2 * 1 + 0 + 0)
+fscore_total = 2. * (1 + 1) / (2 * (1 + 1) + (1 + 0) + (0 + 0))
+np.testing.assert_almost_equal(microF1.get()[1], fscore_total)
+np.testing.assert_almost_equal(macroF1.get()[1], (fscore1 + fscore2) / 2.)
 
 Review comment:
   Yeah, I've just reverted the commit.


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 a change in pull request #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
sxjscience commented on a change in pull request #9777: [MX-9588] Add micro 
averaging strategy for F1 metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#discussion_r168266829
 
 

 ##
 File path: tests/python/unittest/test_metric.py
 ##
 @@ -56,18 +55,51 @@ def test_acc():
 assert acc == expected_acc
 
 def test_f1():
-pred = mx.nd.array([[0.3, 0.7], [1., 0], [0.4, 0.6], [0.6, 0.4], [0.9, 
0.1]])
-label = mx.nd.array([0, 1, 1, 1, 1])
-positives = np.argmax(pred, axis=1).sum().asscalar()
-true_positives = (np.argmax(pred, axis=1) == label).sum().asscalar()
-precision = true_positives / positives
-overall_positives = label.sum().asscalar()
-recall = true_positives / overall_positives
-f1_expected = 2 * (precision * recall) / (precision + recall)
-metric = mx.metric.create('f1')
-metric.update([label], [pred])
-_, f1 = metric.get()
-assert f1 == f1_expected
+microF1 = mx.metric.create("f1", average="micro")
+macroF1 = mx.metric.F1(average="macro")
+
+assert np.isnan(macroF1.get()[1])
+assert np.isnan(microF1.get()[1])
+
+# check divide by zero
+pred = mx.nd.array([[0.9, 0.1],
+[0.8, 0.2]])
+label = mx.nd.array([0, 0])
+macroF1.update([label], [pred])
+microF1.update([label], [pred])
+assert macroF1.get()[1] == 0.0
+assert microF1.get()[1] == 0.0
+macroF1.reset()
+microF1.reset()
+
+pred11 = mx.nd.array([[0.1, 0.9],
+  [0.5, 0.5]])
+label11 = mx.nd.array([1, 0])
+pred12 = mx.nd.array([[0.85, 0.15],
+  [1.0, 0.0]])
+label12 = mx.nd.array([1, 0])
+pred21 = mx.nd.array([[0.6, 0.4]])
+label21 = mx.nd.array([0])
+pred22 = mx.nd.array([[0.2, 0.8]])
+label22 = mx.nd.array([1])
+
+microF1.update([label11, label12], [pred11, pred12])
+macroF1.update([label11, label12], [pred11, pred12])
+assert microF1.num_inst == 4
+assert macroF1.num_inst == 1
+# f1 = 2 * tp / (2 * tp + fp + fn)
+fscore1 = 2. * (1) / (2 * 1 + 1 + 0)
+np.testing.assert_almost_equal(microF1.get()[1], fscore1)
+np.testing.assert_almost_equal(macroF1.get()[1], fscore1)
+
+microF1.update([label21, label22], [pred21, pred22])
+macroF1.update([label21, label22], [pred21, pred22])
+assert microF1.num_inst == 6
+assert macroF1.num_inst == 2
+fscore2 = 2. * (1) / (2 * 1 + 0 + 0)
+fscore_total = 2. * (1 + 1) / (2 * (1 + 1) + (1 + 0) + (0 + 0))
+np.testing.assert_almost_equal(microF1.get()[1], fscore_total)
+np.testing.assert_almost_equal(macroF1.get()[1], (fscore1 + fscore2) / 2.)
 
 Review comment:
   Seems that sklearn is not installed in some machines.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] anirudh2290 commented on issue #9187: Cannot find mxnet-cpp/op.h

2018-02-14 Thread GitBox
anirudh2290 commented on issue #9187: Cannot find mxnet-cpp/op.h
URL: 
https://github.com/apache/incubator-mxnet/issues/9187#issuecomment-365699186
 
 
   @marcoabreu 


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 #9018: Seg Fault on MNIST example - C++

2018-02-14 Thread GitBox
anirudh2290 commented on issue #9018: Seg Fault on MNIST example - C++
URL: 
https://github.com/apache/incubator-mxnet/issues/9018#issuecomment-365699297
 
 
   @marcoabreu 


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 #9417: [cpp-package] inception_bn.cpp is wrong

2018-02-14 Thread GitBox
anirudh2290 commented on issue #9417: [cpp-package] inception_bn.cpp is wrong
URL: 
https://github.com/apache/incubator-mxnet/issues/9417#issuecomment-365699089
 
 
   @marcoabreu 


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 closed pull request #9789: add activations doc

2018-02-14 Thread GitBox
cjolivier01 closed pull request #9789: add activations doc
URL: https://github.com/apache/incubator-mxnet/pull/9789
 
 
   

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/gluon/nn.md b/docs/api/python/gluon/nn.md
index 4515644c6b..91b93bdc7d 100644
--- a/docs/api/python/gluon/nn.md
+++ b/docs/api/python/gluon/nn.md
@@ -17,11 +17,9 @@ This document lists the neural network blocks in Gluon:
 :nosignatures:
 
 Dense
-Activation
 Dropout
 BatchNorm
 InstanceNorm
-LeakyReLU
 Embedding
 Flatten
 ```
@@ -66,6 +64,21 @@ This document lists the neural network blocks in Gluon:
 ReflectionPad2D
 ```
 
+## Activation Layers
+
+
+```eval_rst
+.. autosummary::
+:nosignatures:
+
+Activation
+LeakyReLU
+PReLU
+ELU
+SELU
+Swish
+```
+
 
 ## API Reference
 


 


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 activations doc (#9789)

2018-02-14 Thread cjolivier01
This is an automated email from the ASF dual-hosted git repository.

cjolivier01 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 581cf90  add activations doc (#9789)
581cf90 is described below

commit 581cf9001a87542f59668f45293efea26632ac23
Author: Sheng Zha 
AuthorDate: Wed Feb 14 09:30:46 2018 -0800

add activations doc (#9789)
---
 docs/api/python/gluon/nn.md | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/docs/api/python/gluon/nn.md b/docs/api/python/gluon/nn.md
index 4515644..91b93bd 100644
--- a/docs/api/python/gluon/nn.md
+++ b/docs/api/python/gluon/nn.md
@@ -17,11 +17,9 @@ This document lists the neural network blocks in Gluon:
 :nosignatures:
 
 Dense
-Activation
 Dropout
 BatchNorm
 InstanceNorm
-LeakyReLU
 Embedding
 Flatten
 ```
@@ -66,6 +64,21 @@ This document lists the neural network blocks in Gluon:
 ReflectionPad2D
 ```
 
+## Activation Layers
+
+
+```eval_rst
+.. autosummary::
+:nosignatures:
+
+Activation
+LeakyReLU
+PReLU
+ELU
+SELU
+Swish
+```
+
 
 ## API Reference
 

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


[GitHub] rahul003 commented on issue #8373: distribute training in fp16

2018-02-14 Thread GitBox
rahul003 commented on issue #8373: distribute training in fp16
URL: https://github.com/apache/incubator-mxnet/pull/8373#issuecomment-365677294
 
 
   I'm seeing that fp16 with dist_sync_device is slower than fp32 on a cluster 
of 2 p3.8x instances. (volta gpus)
   
   imagenet-benchmark-alexnet
   fp32: 215 samples/sec
   fp16: 28 samples/sec
   
   cifar10-resnet
   fp32: 760 samples/sec
   fp16: 330 samples/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] sethah commented on a change in pull request #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
sethah commented on a change in pull request #9777: [MX-9588] Add micro 
averaging strategy for F1 metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#discussion_r168239411
 
 

 ##
 File path: tests/python/unittest/test_metric.py
 ##
 @@ -56,18 +55,51 @@ def test_acc():
 assert acc == expected_acc
 
 def test_f1():
-pred = mx.nd.array([[0.3, 0.7], [1., 0], [0.4, 0.6], [0.6, 0.4], [0.9, 
0.1]])
-label = mx.nd.array([0, 1, 1, 1, 1])
-positives = np.argmax(pred, axis=1).sum().asscalar()
-true_positives = (np.argmax(pred, axis=1) == label).sum().asscalar()
-precision = true_positives / positives
-overall_positives = label.sum().asscalar()
-recall = true_positives / overall_positives
-f1_expected = 2 * (precision * recall) / (precision + recall)
-metric = mx.metric.create('f1')
-metric.update([label], [pred])
-_, f1 = metric.get()
-assert f1 == f1_expected
+microF1 = mx.metric.create("f1", average="micro")
+macroF1 = mx.metric.F1(average="macro")
+
+assert np.isnan(macroF1.get()[1])
+assert np.isnan(microF1.get()[1])
+
+# check divide by zero
+pred = mx.nd.array([[0.9, 0.1],
+[0.8, 0.2]])
+label = mx.nd.array([0, 0])
+macroF1.update([label], [pred])
+microF1.update([label], [pred])
+assert macroF1.get()[1] == 0.0
+assert microF1.get()[1] == 0.0
+macroF1.reset()
+microF1.reset()
+
+pred11 = mx.nd.array([[0.1, 0.9],
+  [0.5, 0.5]])
+label11 = mx.nd.array([1, 0])
+pred12 = mx.nd.array([[0.85, 0.15],
+  [1.0, 0.0]])
+label12 = mx.nd.array([1, 0])
+pred21 = mx.nd.array([[0.6, 0.4]])
+label21 = mx.nd.array([0])
+pred22 = mx.nd.array([[0.2, 0.8]])
+label22 = mx.nd.array([1])
+
+microF1.update([label11, label12], [pred11, pred12])
+macroF1.update([label11, label12], [pred11, pred12])
+assert microF1.num_inst == 4
+assert macroF1.num_inst == 1
+# f1 = 2 * tp / (2 * tp + fp + fn)
+fscore1 = 2. * (1) / (2 * 1 + 1 + 0)
+np.testing.assert_almost_equal(microF1.get()[1], fscore1)
+np.testing.assert_almost_equal(macroF1.get()[1], fscore1)
+
+microF1.update([label21, label22], [pred21, pred22])
+macroF1.update([label21, label22], [pred21, pred22])
+assert microF1.num_inst == 6
+assert macroF1.num_inst == 2
+fscore2 = 2. * (1) / (2 * 1 + 0 + 0)
+fscore_total = 2. * (1 + 1) / (2 * (1 + 1) + (1 + 0) + (0 + 0))
+np.testing.assert_almost_equal(microF1.get()[1], fscore_total)
+np.testing.assert_almost_equal(macroF1.get()[1], (fscore1 + fscore2) / 2.)
 
 Review comment:
   Ok, trying this out. We'll see.


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] sethah commented on issue #9777: [MX-9588] Add micro averaging strategy for F1 metric

2018-02-14 Thread GitBox
sethah commented on issue #9777: [MX-9588] Add micro averaging strategy for F1 
metric
URL: https://github.com/apache/incubator-mxnet/pull/9777#issuecomment-365664996
 
 
   Obviously, no change is expected since none of the update logic was changed 
here.
   
   **Before**
   ```
   Metric Data-Ctx  Label-Ctx   Data Size   Batch Size Output Dim   
  Elapsed Time
   
--
   F1 cpu(0)cpu(0)  131072  16 2
  0.82034
   
--
   F1 cpu(0)cpu(0)  131072  64 2
  0.46931
   
--
   F1 cpu(0)cpu(0)  131072  2562
  0.35179
   
--
   F1 cpu(0)cpu(0)  131072  1024   2
  0.35274
   
--
   F1 cpu(0)cpu(0)  16384   16 2
  0.10991
   
--
   F1 cpu(0)cpu(0)  16384   64 2
  0.057258
   
--
   F1 cpu(0)cpu(0)  16384   2562
  0.046497
   
--
   F1 cpu(0)cpu(0)  16384   1024   2
  0.044378
   
--
   F1 cpu(0)cpu(0)  204816 2
  0.01292
   
--
   F1 cpu(0)cpu(0)  204864 2
  0.0070581
   
--
   F1 cpu(0)cpu(0)  20482562
  0.005384
   
--
   F1 cpu(0)cpu(0)  20481024   2
  0.00511
   
--
   ```
   
   **After**
   ```
   Metric Data-Ctx  Label-Ctx   Data Size   Batch Size Output Dim   
  Elapsed Time
   
--
   F1 cpu(0)cpu(0)  131072  16 2
  0.81942
   
--
   F1 cpu(0)cpu(0)  131072  64 2
  0.46574
   
--
   F1 cpu(0)cpu(0)  131072  2562
  0.37653
   
--
   F1 cpu(0)cpu(0)  131072  1024   2
  0.32401
   
--
   F1 cpu(0)cpu(0)  16384   16 2
  0.099127
   
--
   F1 cpu(0)cpu(0)  16384   64 2
  0.057564
   
--
   F1 cpu(0)cpu(0)  16384   2562
  0.044527
   
--
   F1 cpu(0)cpu(0)  16384   1024   2
  0.04604
   
--
   F1 cpu(0)cpu(0)  204816 2
  0.012832
   
--
   F1 cpu(0)cpu(0)  204864 2
  0.0071719
   
--
   F1 cpu(0)cpu(0)  20482562
  0.0058281
   
--
   F1   

[GitHub] rahul003 commented on issue #8373: distribute training in fp16

2018-02-14 Thread GitBox
rahul003 commented on issue #8373: distribute training in fp16
URL: https://github.com/apache/incubator-mxnet/pull/8373#issuecomment-365648029
 
 
   Wondering if this has to do with fp16 being half of fp32, and 6/3=2...


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] rahul003 commented on issue #8373: distribute training in fp16

2018-02-14 Thread GitBox
rahul003 commented on issue #8373: distribute training in fp16
URL: https://github.com/apache/incubator-mxnet/pull/8373#issuecomment-365647665
 
 
   I have merged and rebased this onto master, and I see this error.
   
   ```what():  [15:42:31] src/kvstore/././kvstore_dist_server.h:484: Check 
failed: req_data.vals.size() == (size_t)req_data.lens[0] (6 vs. 3)```
   
   Trying to debug it. But I don't really understand why req_data.vals.size() 
becomes 6. On worker's side it is trying to send an array of size 3. Have you 
seen this ever? 
   
   The code is on https://github.com/rahul003/mxnet/tree/fp16


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] rahul003 commented on issue #8373: distribute training in fp16

2018-02-14 Thread GitBox
rahul003 commented on issue #8373: distribute training in fp16
URL: https://github.com/apache/incubator-mxnet/pull/8373#issuecomment-365648029
 
 
   Wondering if this has to do with fp16 being half of fp32, and 6/3=2...


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] rahul003 commented on issue #8373: distribute training in fp16

2018-02-14 Thread GitBox
rahul003 commented on issue #8373: distribute training in fp16
URL: https://github.com/apache/incubator-mxnet/pull/8373#issuecomment-365647665
 
 
   I have merged and rebased this onto master, and I see this error.
   
   ```what():  [15:42:31] src/kvstore/././kvstore_dist_server.h:484: Check 
failed: req_data.vals.size() == (size_t)req_data.lens[0] (6 vs. 3)```
   
   Trying to debug it. But I don't really understand why req_data.vals.size() 
becomes 6. On worker's side it is trying to send an array of size 3. Have you 
seen this ever? 
   
   The code is on https://github.com/rahul003/mxnet/tree/fp16


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] rahul003 commented on a change in pull request #8373: distribute training in fp16

2018-02-14 Thread GitBox
rahul003 commented on a change in pull request #8373: distribute training in 
fp16
URL: https://github.com/apache/incubator-mxnet/pull/8373#discussion_r168215044
 
 

 ##
 File path: src/kvstore/kvstore_dist_server.h
 ##
 @@ -378,25 +379,46 @@ class KVStoreDistServer {
 if (req_meta.push) {
   size_t ds[] = {(size_t)req_data.lens[0]};
   TShape dshape(ds, ds + 1);
-  TBlob recv_blob((real_t*)req_data.vals.data(), // NOLINT(*)
+  TBlob recv_blob((DType*)req_data.vals.data(), // NOLINT(*)
   dshape, cpu::kDevMask);
   NDArray recved = NDArray(recv_blob, 0);
+  NDArray recved_tmp;
+  if (recved.dtype() != mshadow::DataType::kFlag) {
+recved.WaitToRead();
+recved_tmp = NDArray(dshape, Context::CPU(0), false, 
mshadow::DataType::kFlag);
+CopyFromTo(recved, &recved_tmp, 0);
+recved_tmp.WaitToRead();
+  }
   if (stored.is_none()) {
 // initialization
-stored = NDArray(dshape, Context());
-CopyFromTo(recved, &stored, 0);
+if (recved.dtype() != mshadow::DataType::kFlag) {
+  stored = NDArray(dshape, Context::CPU(0), false, 
mshadow::DataType::kFlag);
 
 Review comment:
   ok 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] eric-haibin-lin commented on issue #9213: Crash when MXNet API called before spawning multiprocess

2018-02-14 Thread GitBox
eric-haibin-lin commented on issue #9213: Crash when MXNet API called before 
spawning multiprocess
URL: 
https://github.com/apache/incubator-mxnet/issues/9213#issuecomment-365602224
 
 
   Before #8995 using Gluon data loader w/ num_workers > 2 will result:
   ```
   terminate called after throwing an instance of 'std::system_error'
 what():  Operation not permitted
   Aborted (core dumped)
   ```


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] kthr opened a new issue #9794: MKL linker error on macOS 10.13 despite using configuration without MKL

2018-02-14 Thread GitBox
kthr opened a new issue #9794: MKL linker error on macOS 10.13 despite using 
configuration without MKL
URL: https://github.com/apache/incubator-mxnet/issues/9794
 
 
   ## Description
   Compiling from source on macOS 10.13.3 gives the following linker errors:
   ```
   /opt/local/bin/ranlib: file: lib/libmxnet.a(mkl_cppwrapper.o) has no symbols
   /opt/local/bin/ranlib: file: lib/libmxnet.a(mkl_memory.o) has no symbols
   /opt/local/bin/ranlib: file: lib/libmxnet.a(nnpack_util.o) has no symbols
   ```
   despite not being configured to use MKL
   
   ## Environment info (Required)
   
[diagnose.txt](https://github.com/apache/incubator-mxnet/files/1724012/diagnose.txt)
   
   ## Build info (Required if built from source)
   Compiler clang
   
   MXNet commit hash:
   45e85553219e07406f87a094f7aa41b30c611220
   
   Build config:
   
[config.txt](https://github.com/apache/incubator-mxnet/files/1724014/config.txt)
   
   
   ## Error Message:
   ```
   /opt/local/bin/ranlib: file: lib/libmxnet.a(mkl_cppwrapper.o) has no symbols
   /opt/local/bin/ranlib: file: lib/libmxnet.a(mkl_memory.o) has no symbols
   /opt/local/bin/ranlib: file: lib/libmxnet.a(nnpack_util.o) has no symbols
   ```


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] juliusshufan opened a new pull request #9793: Enable the reporting of cross-entropy or nll loss value when training CNN network using the models defined by example/image-classification

2018-02-14 Thread GitBox
juliusshufan opened a new pull request #9793: Enable the reporting of 
cross-entropy or nll loss value when training CNN network using the models 
defined by example/image-classification
URL: https://github.com/apache/incubator-mxnet/pull/9793
 
 
   ## Description ##
   MxNET already implements the loss computation at Python layer (in 
python/mxnet/metric.py) 
   For most of the CNN models used for image-classification, as softmax is 
commonly used as the output, the cross-entropy or likelihood loss value is 
helpful to monitor the convergence trend during training.
   The current implementation of example/image-classification/fit.py already 
provides an extensible implementation to report some useful information during 
training, such as accuracy. 
   My submission utilizes this design and enabling the report of cross-entropy 
or nll loss value during training.

   ## 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 ###
   All the code changes are in example/image-classification/common/fit.py
   A new argument '--loss' is introduced, and it can be set as 'ce' or 
'nll-loss' corresponding to cross-entropy loss and negative likelihood loss 
respectively.
   Taking the train_cifar10.py as an example, the loss value will be reported 
if the below **bold code line** added,
   parser.set_defaults(
   ..
   **loss   = 'ce'**
   ..
   )
   The output log will be the following pattern:
   INFO:root:Epoch[0] Batch [380]  Speed: 504.42 samples/sec   
accuracy=0.087109   top_k_accuracy_5=0.469531   
**cross-entropy=2.305971**
   INFO:root:Epoch[0] Train-accuracy=0.098437
   INFO:root:Epoch[0] Train-top_k_accuracy_5=0.506250
   INFO:root:Epoch[0] **Train-cross-entropy=2.304529**
   INFO:root:Epoch[0] Time cost=100.989
   INFO:root:Epoch[0] Validation-accuracy=0.098101
   INFO:root:Epoch[0] Validation-top_k_accuracy_5=0.486946
   INFO:root:Epoch[0] **Validation-cross-entropy=2.302873**
   
   ## 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] marcoabreu commented on issue #9791: CI test randomness 3

2018-02-14 Thread GitBox
marcoabreu commented on issue #9791: CI test randomness 3
URL: https://github.com/apache/incubator-mxnet/pull/9791#issuecomment-365594780
 
 
   Would it be possible to write a test for this feature? Especially around the 
``with random_seed():``


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] marcoabreu commented on issue #9791: CI test randomness 3

2018-02-14 Thread GitBox
marcoabreu commented on issue #9791: CI test randomness 3
URL: https://github.com/apache/incubator-mxnet/pull/9791#issuecomment-365594449
 
 
   ```
   ==
   
   FAIL: test_operator.test_rcbrt_op
   
   --
   
   Traceback (most recent call last):
   
 File "C:\Anaconda3\envs\py2\lib\site-packages\nose\case.py", line 197, in 
runTest
   
   self.test(*self.arg)
   
 File 
"C:\jenkins_slave\workspace\ut-python-cpu\tests\python\unittest\common.py", 
line 152, in test_new
   
   orig_test(*args, **kwargs)
   
 File 
"C:\jenkins_slave\workspace\ut-python-cpu\tests\python\unittest\test_operator.py",
 line 3807, in test_rcbrt_op
   
   check_numeric_gradient(test, [data_tmp])
   
 File 
"C:\jenkins_slave\workspace\ut-python-cpu\pkg_vc14_cpu\python\mxnet\test_utils.py",
 line 914, in check_numeric_gradient
   
   ("NUMERICAL_%s"%name, "BACKWARD_%s"%name))
   
 File 
"C:\jenkins_slave\workspace\ut-python-cpu\pkg_vc14_cpu\python\mxnet\test_utils.py",
 line 493, in assert_almost_equal
   
   raise AssertionError(msg)
   
   AssertionError: 
   
   Items are not equal:
   
   Error 1.311829 exceeds tolerance rtol=0.01, atol=0.00.  Location of 
maximum error:(2, 1), a=-84.507408, b=-83.413170
   
NUMERICAL_data: array([[ -1.68704987,  -0.4118681 ,  -0.0692606 ,  
-0.00718236],
   
  [ -0.02065301,  -0.03251433,  -0.16596913,  -0.01351535],
   
  [ -0.37240982, -84.50740814,  -0.02904981,  -0.08755922]], 
dtype=float32)
   
BACKWARD_data: array([[ -1.68707681,  -0.41187629,  -0.06918965,  
-0.00718444],
   
  [ -0.02061475,  -0.03253891,  -0.16597052,  -0.01352422],
   
  [ -0.3723917 , -83.41316986,  -0.02905715,  -0.08757117]], 
dtype=float32)
   
    >> begin captured logging << 
   
   common: INFO: Setting test np/mx/python random seeds, use 
MXNET_TEST_SEED=788174893 to reproduce.
   
   - >> end captured logging << -
   ```
   
   Awesome!


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 #8627: Documentation update for gluon.nn.Dense. `flatten` invalid keyword argument.

2018-02-14 Thread GitBox
szha commented on issue #8627: Documentation update for gluon.nn.Dense. 
`flatten` invalid keyword argument.
URL: 
https://github.com/apache/incubator-mxnet/issues/8627#issuecomment-365592375
 
 
   @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] marcoabreu commented on a change in pull request #9791: CI test randomness 3

2018-02-14 Thread GitBox
marcoabreu commented on a change in pull request #9791: CI test randomness 3
URL: https://github.com/apache/incubator-mxnet/pull/9791#discussion_r168138105
 
 

 ##
 File path: tests/python/unittest/test_operator.py
 ##
 @@ -2265,18 +2317,18 @@ def check_instance_norm_with_shape(shape, xpu):
numeric_eps=1e-2, rtol=1e-2, atol=1e-2)
 
 
+@with_seed()
 def test_instance_normalization():
 check_instance_norm_with_shape((1, 1, 1), default_context())
 check_instance_norm_with_shape((2, 1, 2), default_context())
 check_instance_norm_with_shape((2,4,5,6), default_context())
 check_instance_norm_with_shape((3,3,2,3,2,1,1), default_context())
 
 
-def check_l2_normalization(in_shape, mode, ctx=default_context(), 
norm_eps=1e-10):
+def check_l2_normalization(in_shape, mode, norm_eps=1e-10):
+ctx = default_context()
 data = mx.symbol.Variable('data')
 out = mx.symbol.L2Normalization(data=data, mode=mode, eps=norm_eps)
-# TODO(szha): Seeding this masks failures. We need to do a deep dive for 
failures without this seed.
 
 Review comment:
   Don't remove the TODO


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 a change in pull request #9791: CI test randomness 3

2018-02-14 Thread GitBox
marcoabreu commented on a change in pull request #9791: CI test randomness 3
URL: https://github.com/apache/incubator-mxnet/pull/9791#discussion_r168137653
 
 

 ##
 File path: tests/python/unittest/test_autograd.py
 ##
 @@ -360,8 +373,12 @@ def backward(self, dm, dn):
 
 assert_almost_equal(x.grad.asnumpy(), dx1)
 assert_almost_equal(y.grad.asnumpy(), dy1)
+#atol = 1e-6
+#assert_almost_equal(x.grad.asnumpy(), dx1, atol=atol)
+#assert_almost_equal(y.grad.asnumpy(), dy1, atol=atol)
 
 Review comment:
   TODO: Restore?


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   >