Skip to content

Instantly share code, notes, and snippets.

@ivikash
Created March 16, 2017 12:14
Show Gist options
  • Save ivikash/a316cda555a5ddee7980b6a2e1c0258b to your computer and use it in GitHub Desktop.
Save ivikash/a316cda555a5ddee7980b6a2e1c0258b to your computer and use it in GitHub Desktop.
Some basic and important functions for deep learning
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def softmax(x):
return np.exp(x)/np.sum(np.exp(x))
def cross_entropy(y_vector, y_one_hot):
return -np.sum(y_one_hot * np.log(y_vector))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment