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

Commit

Permalink
Remove Epoch training metric log
Browse files Browse the repository at this point in the history
  • Loading branch information
vandanavk committed Aug 23, 2018
1 parent ac85d7a commit b524a3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 0 additions & 6 deletions python/mxnet/module/base_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,6 @@ def fit(self, train_data, eval_data=None, eval_metric='acc',
if monitor is not None:
monitor.toc_print()

if end_of_batch:
eval_name_vals = eval_metric.get_name_value()

if batch_end_callback is not None:
batch_end_params = BatchEndParam(epoch=epoch, nbatch=nbatch,
eval_metric=eval_metric,
Expand All @@ -553,9 +550,6 @@ def fit(self, train_data, eval_data=None, eval_metric='acc',
callback(batch_end_params)
nbatch += 1

# one epoch of training is finished
for name, val in eval_name_vals:
self.logger.info('Epoch[%d] Train-%s=%f', epoch, name, val)
toc = time.time()
self.logger.info('Epoch[%d] Time cost=%.3f', epoch, (toc-tic))

Expand Down
7 changes: 3 additions & 4 deletions tools/parse_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
with open(args.logfile[0]) as f:
lines = f.readlines()

res = [re.compile('.*Epoch\[(\d+)\] Train-'+s+'.*=([.\d]+)') for s in args.metric_names]\
+ [re.compile('.*Epoch\[(\d+)\] Validation-'+s+'.*=([.\d]+)') for s in args.metric_names]\
res = [re.compile('.*Epoch\[(\d+)\] Validation-'+s+'.*=([.\d]+)') for s in args.metric_names]\
+ [re.compile('.*Epoch\[(\d+)\] Time.*=([.\d]+)')]

data = {}
Expand All @@ -63,11 +62,11 @@
data[epoch][i*2+1] += 1

if args.format == 'markdown':
print("| epoch | " + " | ".join(['train-'+s for s in args.metric_names]) + " | " + " | ".join(['val-'+s for s in args.metric_names]) + " | time |")
print("| epoch | " + " | ".join(['val-'+s for s in args.metric_names]) + " | time |")
print("| --- "*(len(res)+1) + "|")
for k, v in data.items():
print("| %2d | " % (k+1)\
+ " | ".join(["%f" % (v[2*j]/v[2*j+1]) for j in range(2*len(args.metric_names))])\
+ " | ".join(["%f" % (v[2*j]/v[2*j+1]) for j in range(len(args.metric_names))])\
+ " | %.1f |" % (v[-2]/v[-1]))
elif args.format == 'none':
print("\t".join(['epoch'] + ['train-' + s for s in args.metric_names] + ['val-' + s for s in args.metric_names] + ['time']))
Expand Down

0 comments on commit b524a3e

Please sign in to comment.