Created
September 4, 2020 02:42
-
-
Save seong-min-s/cbc7806f673e398ce5316c99673328e4 to your computer and use it in GitHub Desktop.
softmax
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 softmax(x): | |
return np.exp(x)/np.sum(np.exp(x)) | |
input_signal = np.random.randn(5)+2 | |
output_signal = softmax(input_signal) | |
print("input_signals : {}".format(input_signal)) | |
print("output_signals : {}".format(output_signal)) | |
print("The sum of output_signals : {}".format(output_signal.sum())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment