Softmax & cross-entropy
Step 7 of 14 in Deep Learning · Build · Easy
Softmax turns scores into probabilities; cross-entropy is the negative log-probability of the right class. Their combined gradient is simply p − y.
Build it
Stable implementation
softmax and cross_entropy in NumPy with max subtraction; derive and check the p − y gradient.
Done when: No overflow at logits of 1000; gradient check passes.
Resources
- Wikipedia: Softmax function Article
- Karpathy: Zero to Hero Course
- Dive into Deep Learning Book
Earn this star
On the map, you log what you built. Finish the step and its star lights.
Open this step on the map