Skip to content

Instantly share code, notes, and snippets.

@seong-min-s
Created September 4, 2020 02:42
Show Gist options
  • Save seong-min-s/cbc7806f673e398ce5316c99673328e4 to your computer and use it in GitHub Desktop.
Save seong-min-s/cbc7806f673e398ce5316c99673328e4 to your computer and use it in GitHub Desktop.
softmax
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