oa::ml::metric::Perplexity
Additive token-NLL moments behind perplexity. Perplexity is exp(sum(nll × tokens) / sum(tokens)) with the exponential applied only at observation time. Batches contribute their token-weighted mean negative log-likelihood — exactly what cross_entropy_masked returns when its valid_count is the token denominator — so partitioned language evaluation merges exactly. The contract forbids the mean of per-batch perplexities, which is not the corpus perplexity. Empty denominators report NaN.
Declaration
pub struct Perplexity { /* private fields */ }Public Rust declaration.
Public Methods
Associated Functions
Public Method Documentation
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.