Syllabus Lesson 88 of 239 · Your First Machine Learning Models
Your First Machine Learning Models

Watch: Softmax

Logistic regression gave you a probability for two classes. What about many classes, or any time a model has to turn raw scores into a clean set of probabilities? That job belongs to softmax.

Press play. Watch four raw scores (logits) get exponentiated (which amplifies the lead) and then normalized so they add up to exactly 1, becoming a probability distribution. This one function shows up everywhere ahead: attention weights, classifiers, and an LLM choosing its next token.

Spotted a problem in this lesson? Report it

Code · runs in your browser
Output