pub fn perplexity(log_probs: &[f64]) -> f64
Perplexity: exp(mean negative log-prob) over a sequence of log-probabilities.