Last active
June 15, 2018 23:08
-
-
Save Alescontrela/0428c8ac33183b09fa483806268f32e6 to your computer and use it in GitHub Desktop.
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
def softmax(raw_preds): | |
''' | |
pass raw predictions through softmax activation function | |
''' | |
out = np.exp(raw_preds) # exponentiate vector of raw predictions | |
return out/np.sum(out) # divide the exponentiated vector by its sum. All values in the output sum to 1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment