From c68cc3bdde8a00b19037f38715d31d077f194679 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 27 Aug 2024 04:31:37 +0530 Subject: [PATCH] Update `grad_tanh(1.0)` value --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 43242fb70..812d76ad6 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,11 @@ Example use: >>> from autograd import grad # The only autograd function you may ever need >>> >>> def tanh(x): # Define a function -... return (1.0 - np.exp(-x)) / (1.0 + np.exp(-x)) +... 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 -0.41997434161402603 +np.float64(0.39322386648296376) >>> (tanh(1.0001) - tanh(0.9999)) / 0.0002 # Compare to finite differences 0.41997434264973155 ```