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

 ##########
 File path: python/mxnet/metric.py
 ##########
 @@ -768,18 +865,25 @@ def update(self, labels, preds):
         for label, pred in zip(labels, preds):
             self._metrics.update_binary_stats(label, pred)
 
+        matthewscc = self._metrics.matthewscc
         if self._average == "macro":
-            self.sum_metric += self._metrics.matthewscc
+            self.sum_metric += matthewscc
+            self.global_sum_metric += matthewscc
             self.num_inst += 1
+            self.global_num_inst += 1
             self._metrics.reset_stats()
         else:
-            self.sum_metric = self._metrics.matthewscc * 
self._metrics.total_examples
+            self.sum_metric = matthewscc * self._metrics.total_examples
+            self.global_sum_metric = matthewscc * self._metrics.total_examples
             self.num_inst = self._metrics.total_examples
+            self.global_num_inst = self._metrics.total_examples
 
 Review comment:
   similarly 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

Reply via email to