vandanavk commented on a change in pull request #13471: Optimization of metric
evaluation
URL: https://github.com/apache/incubator-mxnet/pull/13471#discussion_r237961120
##########
File path: python/mxnet/metric.py
##########
@@ -667,18 +756,25 @@ def update(self, labels, preds):
for label, pred in zip(labels, preds):
self.metrics.update_binary_stats(label, pred)
+ fscore = self.metrics.fscore
if self.average == "macro":
- self.sum_metric += self.metrics.fscore
+ self.sum_metric += fscore
+ self.global_sum_metric += fscore
self.num_inst += 1
+ self.global_num_inst += 1
self.metrics.reset_stats()
else:
- self.sum_metric = self.metrics.fscore * self.metrics.total_examples
+ self.sum_metric = fscore * self.metrics.total_examples
+ self.global_sum_metric = fscore * 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:
[email protected]
With regards,
Apache Git Services