MCPcopy Create free account
hub / github.com/OpenMeshLab/MeshXL / perplexity

Function perplexity

eval_utils/perplexity.py:13–16  ·  view source on GitHub ↗
(neg_log_likelihood: list)

Source from the content-addressed store, hash-verified

11
12
13def perplexity(neg_log_likelihood: list) -> Tensor:
14 # gather per-sequence log likelihood for perplexity
15 nll_chunk = torch.cat(neg_log_likelihood, dim=0)
16 return torch.exp(nll_chunk.mean())
17
18
19

Callers 1

evaluateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected