• | Perplexity calculates how well a probability | distribution predicts a sample. | | Perplexity takes a 1-D tensor containing | a batch of probabilities. Each value | in the tensor belongs to a different | sample and represents the probability | of the model predicting the true label | for that sample. The operator returns | a single (float) perplexity value for | the batch. |