Zaremba et al. (2014) regularize LSTM language models with dropout on the non-recurrent connections, and report results in perplexity. Perplexity is the exponential of the average per-token loss, so it reads as an effective number of choices per token.
Implement perplexity(total_nll, n), the exponential of the average negative log-likelihood per token.
Divide the total loss by the token count, then exponentiate.
No results yet
Run your code to check it against the examples, or submit to run every test.