Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Optimization of metric evaluation (#13471)
Browse files Browse the repository at this point in the history
* Change argsort to argpartition

* Global statistics in metrics

* Fix lint

* Fixes from review

* Trigger

* Fixes from review, fix to F1, MCC and perplexity metrics,
added test for global stats

* Fix lint

* Fix compatibility with Python 2
  • Loading branch information
ptrendx authored and sandeep-krishnamurthy committed Dec 13, 2018
1 parent aca93d8 commit 98750fe
Show file tree
Hide file tree
Showing 4 changed files with 330 additions and 49 deletions.
4 changes: 2 additions & 2 deletions python/mxnet/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _callback(param):
logging.info('Iter[%d] Batch[%d] Train-%s=%f',
param.epoch, param.nbatch, name, value)
if auto_reset:
param.eval_metric.reset()
param.eval_metric.reset_local()
return _callback


Expand Down Expand Up @@ -164,7 +164,7 @@ def __call__(self, param):
if param.eval_metric is not None:
name_value = param.eval_metric.get_name_value()
if self.auto_reset:
param.eval_metric.reset()
param.eval_metric.reset_local()
msg = 'Epoch[%d] Batch [%d-%d]\tSpeed: %.2f samples/sec'
msg += '\t%s=%f'*len(name_value)
logging.info(msg, param.epoch, count-self.frequent, count, speed, *sum(name_value, ()))
Expand Down
Loading

0 comments on commit 98750fe

Please sign in to comment.