Created
September 27, 2016 05:29
-
-
Save domluna/8c9f54ef10f22c80d9632f5f71f5d119 to your computer and use it in GitHub Desktop.
Derivatives for softmax and cross entropy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# derivs | |
# cross entropy -1/p deriv of -log(p) | |
# softmax | |
# p * (1 - p) if i == j if this is the node we picked | |
# -p * p if i != j otherwise | |
# | |
# chain rule for both functions dsoftmax * dcross_entropy | |
# p * (1 - p) * (-1/p) = p - 1 | |
# -p * p * (-1/p) = p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment