Created
March 16, 2017 12:14
-
-
Save ivikash/a316cda555a5ddee7980b6a2e1c0258b to your computer and use it in GitHub Desktop.
Some basic and important functions for deep learning
This file contains hidden or 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
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