logoalt Hacker News

xchiptoday at 10:40 AM1 replyview on HN

"This transforms a vector of arbitrary real numbers into values between 0 and 1 that sum to 1"

Not really, softmax transforms logits (logariths of probabilities) into probabilities.

Probabilities → logits → back again.

Start with p = [0.6, 0.3, 0.1]. Logits = log(p) = [-0.51, -1.20, -2.30]. Softmax(logits) = original p.

NN prefer to output logits because they are linear and go from -inf to +inf.


Replies

ForceBrutoday at 10:57 AM

It's still true that softmax transforms arbitrary vectors into probability vectors.

In your example you'll also get the original `p` with just `exp(logits)`. Softmax normalizes the output to sum to one, so it can output a probability vector even if the input is _not_ simply `log(p)`.