You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2018/01/29 22:14:10 UTC

[incubator-mxnet] branch master updated: proper flatten in acc (#9619)

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new ed823b2  proper flatten in acc (#9619)
ed823b2 is described below

commit ed823b2e187eb859d9475eb651465edf714c6c5f
Author: Sheng Zha <sz...@users.noreply.github.com>
AuthorDate: Mon Jan 29 14:14:07 2018 -0800

    proper flatten in acc (#9619)
---
 python/mxnet/metric.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/mxnet/metric.py b/python/mxnet/metric.py
index f1cdae2..fc2b901 100644
--- a/python/mxnet/metric.py
+++ b/python/mxnet/metric.py
@@ -399,7 +399,7 @@ class Accuracy(EvalMetric):
             if pred_label.context != label.context:
                 pred_label = pred_label.as_in_context(label.context)
 
-            self.sum_metric += (pred_label.flatten() == label.flatten()).sum().asscalar()
+            self.sum_metric += (pred_label.reshape((-1,)) == label.reshape((-1,))).sum().asscalar()
             self.num_inst += numpy.prod(pred_label.shape)
 
 

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