From 76e37e0253e50b4428eacb6baf455591564abd29 Mon Sep 17 00:00:00 2001 From: Jiaqi Date: Wed, 21 Apr 2021 10:14:08 +0800 Subject: [PATCH] ppl api --- mindspore/nn/metrics/perplexity.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mindspore/nn/metrics/perplexity.py b/mindspore/nn/metrics/perplexity.py index 350f7a4c7f..fc3c330ab3 100644 --- a/mindspore/nn/metrics/perplexity.py +++ b/mindspore/nn/metrics/perplexity.py @@ -25,8 +25,7 @@ class Perplexity(Metric): sample. A low perplexity indicates the model can predict the sample well. The function is shown as follows: .. math:: - b^{\\big(-\\frac{1}{N} \\sum_{i=1}^N \\log_b q(x_i) \\big)} - = \\exp \\big(-\\frac{1}{N} \\sum_{i=1}^N \\log q(x_i)\\big) + PP(W)=P(w_{1}w_{2}...w_{N})^{-\frac{1}{N}}=\sqrt[N]{\frac{1}{P(w_{1}w_{2}...w_{N})}} Args: ignore_label (int): Index of an invalid label to be ignored when counting. If set to `None`, it will include all