Skip to content

Instantly share code, notes, and snippets.

@sethbunke
Created May 8, 2017 22:26
Show Gist options
  • Save sethbunke/6295844838ad1eabb3baf8fae794f1dd to your computer and use it in GitHub Desktop.
Save sethbunke/6295844838ad1eabb3baf8fae794f1dd to your computer and use it in GitHub Desktop.
tanh and tanh derivative
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