class_docstr: Accumulator for loss statistics.
  Currently calculates:
  
  * accuracy
  * perplexity
  * elapsed time
docstr: compute perplexity
docstr_tok: ["compute","perplexity"]
code: def ppl(self):
      """compute perplexity"""
      return math.exp(min(self.loss / self.n_words, 100))
  
file_path: OpenNMT-py/onmt/utils/statistics.py
imports: import time
  import math
  import sys
  from onmt.utils.logging import logger
label_desc: Use image node_id 7 for calling the Statistics obj's underlying member method code with example usage: obj.ppl() and returns: math