Skip to content

Instantly share code, notes, and snippets.

@agnesmm

agnesmm/a3g5.py Secret

Created September 19, 2017 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agnesmm/18c862a30510735f8df184e60213a7d0 to your computer and use it in GitHub Desktop.
Save agnesmm/18c862a30510735f8df184e60213a7d0 to your computer and use it in GitHub Desktop.
import numpy as np
def softmax(x):
return np.exp(x) / np.sum(np.exp(x), axis=0)
x = np.random.randint(20, size=6)
print(x)
print(softmax(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment