sandeep-krishnamurthy commented on a change in pull request #13471: 
Optimization of metric evaluation
URL: https://github.com/apache/incubator-mxnet/pull/13471#discussion_r239667679
 
 

 ##########
 File path: python/mxnet/metric.py
 ##########
 @@ -487,7 +569,7 @@ def update(self, labels, preds):
 
         for label, pred_label in zip(labels, preds):
             assert(len(pred_label.shape) <= 2), 'Predictions should be no more 
than 2 dims'
-            pred_label = numpy.argsort(pred_label.asnumpy().astype('float32'), 
axis=1)
+            pred_label = 
numpy.argpartition(pred_label.asnumpy().astype('float32'), -self.top_k)
 
 Review comment:
   This is very nice. I think it warrants a comment on why argpartition is used 
here (for its performance benefit)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to