Skip to main content

Module math

Module math 

Source
Expand description

Turning label logprobs into probabilities and a confidence.

Functionsยง

argmax
The index of the largest probability. Ties go to the lower index.
confidence
How peaked a distribution is, in 0.0..=1.0.
expected_level
The probability-weighted mean of 1-based level indices.
logsumexp
Combine logprobs of several tokens that mean the same answer, in probability space.
softmax
Softmax over logprobs, with temperature scaling applied first.