From 74d2dfd96ddf94a93c38f2f62a2933afb9ba878d Mon Sep 17 00:00:00 2001 From: Edward Medvedev Date: Fri, 29 Sep 2017 03:29:06 +0700 Subject: [PATCH] Fix the perplexity value --- aocr/model/model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aocr/model/model.py b/aocr/model/model.py index aca72661..cb5e4df4 100644 --- a/aocr/model/model.py +++ b/aocr/model/model.py @@ -345,6 +345,7 @@ def train(self): step_time, loss = 0.0, 0.0 # Print statistics for the previous epoch. + perplexity = math.exp(loss) if loss < 300 else float('inf') logging.info("Global step %d. Time: %.3f, loss: %f, perplexity: %.2f." % (self.sess.run(self.global_step), step_time, loss, perplexity)) # Save checkpoint and reset timer and loss.