Skip to content

Commit

Permalink
fix dev loss word count is taken from the first dev task (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmwe authored and msperber committed May 23, 2018
1 parent 038a700 commit 76f4e7f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xnmt/training_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,13 @@ def checkpoint(self, control_learning_schedule=True):
# Perform evaluation
if self.dev_tasks and len(self.dev_tasks) > 0:
dev_scores = []
dev_word_cnt = None
with self.dev_loss_tracker.time_tracker:
logger.info("> Checkpoint")
for dev_task in self.dev_tasks:
dev_score, dev_word_cnt = dev_task.eval()
dev_score, tmp_word_cnt = dev_task.eval()
if dev_word_cnt is None:
dev_word_cnt = tmp_word_cnt
if type(dev_score) == list:
dev_scores.extend(dev_score)
else:
Expand Down

0 comments on commit 76f4e7f

Please sign in to comment.