This tool divides three scores, called logits, by a temperature T and turns them into probabilities with softmax.
The calculation runs in your browser, and the numbers are not sent anywhere.
Scores (logits):
T = 1.0
Each score is divided by T, then softmax turns the scores into probabilities that add up to 1. T below 1 makes the top option more likely; T above 1 spreads the chances out.
| Option | Score | Probability at T = 1 | Probability at T = 1.0 | |
|---|---|---|---|---|
| 1 | 1 | 0.0900 | 0.0900 | |
| 2 | 2 | 0.2447 | 0.2447 | |
| 3 | 3 | 0.6652 | 0.6652 |
Draw picks one option at random, using the probabilities at the chosen T.
The calculation runs in this browser. The numbers are not sent anywhere.
The Python below divides the scores 1, 2, 3 by T and applies softmax, for T = 1 and T = 2.
import math
def softmax(scores):
biggest = max(scores)
exps = [math.exp(s - biggest) for s in scores]
total = sum(exps)
return [e / total for e in exps]
logits = [1, 2, 3]
for T in (1, 2):
probs = softmax([x / T for x in logits])
print(f"T = {T}:", [f"{p:.4f}" for p in probs])
# T = 1: ['0.0900', '0.2447', '0.6652']
# T = 2: ['0.1863', '0.3072', '0.5065']