Perplexity in opennmt-tf

I use opennmt-tf and train_and_eval. During traing, I get loss. During eval, I use external_evaluators to get BLEU and BLEU-detok scores. But I also want to get perplexity. How can I get perplexity?


The eval also reports the loss which is the cross entropy. So you can derive the perplexity from the loss:

perplexity = exp(loss)
1 Like