Skip to contents

exp(-mean log p); positive log-probabilities are refused because they are probabilities or logits, not natural logs.

Usage

morie_kamath_perplexity(log_probs, base = "e")

Arguments

log_probs

Log-probabilities (<= 0).

base

"e" or "2".

Value

List with estimate, mean_nll, bits_per_token.

Examples

morie_kamath_perplexity(c(-1, -2))
#> $estimate
#> [1] 4.481689
#> 
#> $perplexity
#> [1] 4.481689
#> 
#> $mean_nll
#> [1] 1.5
#> 
#> $total_nll
#> [1] 3
#> 
#> $bits_per_token
#> [1] 2.164043
#> 
#> $base
#> [1] "e"
#> 
#> $n
#> [1] 2
#> 
#> $method
#> [1] "Perplexity exp(mean negative log-likelihood)"
#>