Created
September 28, 2018 04:43
-
-
Save mdhasanai/2d3d9c3d0b6c416360a49dc9974c5564 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(x): | |
"""Compute softmax values for each sets of scores in x.""" | |
e_x = np.exp(x - np.max(x)) | |
s = e_x / e_x.sum() | |
return s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment