Created
January 12, 2017 14:43
-
-
Save motokiee/9131f8768be0bf9c17d042cb0cf6952e 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
import numpy as np | |
def soft_max(a): | |
c = np.max(a) | |
exp_a = np.exp(a-c) | |
sum_exp_a = np.sum(exp_a) | |
y = exp_a / sum_exp_a | |
return y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment