Skip to content

Commit

Permalink
Modify tanh code for README
Browse files Browse the repository at this point in the history
  • Loading branch information
koki0702 committed Feb 13, 2019
1 parent ad40924 commit e84b525
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ Example use:
>>> from autograd import grad # The only autograd function you may ever need
>>>
>>> def tanh(x): # Define a function
... y = np.exp(-2.0 * x)
... return (1.0 - y) / (1.0 + y)
... return (1.0 - np.exp(-x)) / (1.0 + np.exp(-x))
...
>>> grad_tanh = grad(tanh) # Obtain its gradient function
>>> grad_tanh(1.0) # Evaluate the gradient at x = 1.0
Expand Down

0 comments on commit e84b525

Please sign in to comment.