Created
May 8, 2017 22:26
-
-
Save sethbunke/6295844838ad1eabb3baf8fae794f1dd to your computer and use it in GitHub Desktop.
tanh and tanh derivative
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 tanh(x): | |
return (1.0 - numpy.exp(-2*x))/(1.0 + numpy.exp(-2*x)) | |
def tanh_derivative(x): | |
return (1 + tanh(x))*(1 - tanh(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment