Skip to content

Commit

Permalink
Fix minor typo in cell (#2692)
Browse files Browse the repository at this point in the history
* Fix minor typo in cell

One of the arguments to `hvp` wasn't being used, which made the example slightly confusing.

* Fix both definitions of hvp in the autodiff cookbook.

Co-authored-by: Peter Hawkins <phawkins@google.com>
  • Loading branch information
langosco and hawkinsp authored Apr 14, 2020
1 parent 7f6ede1 commit d6ab70c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/notebooks/autodiff_cookbook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
"outputs": [],
"source": [
"def hvp(f, x, v):\n",
" return grad(lambda x: np.vdot(grad(f)(x), v))"
" return grad(lambda x: np.vdot(grad(f)(x), v))(x)"
]
},
{
Expand Down Expand Up @@ -899,7 +899,7 @@
"outputs": [],
"source": [
"def hvp(f, x, v):\n",
" return grad(lambda x: np.vdot(grad(f)(x), v))"
" return grad(lambda x: np.vdot(grad(f)(x), v))(x)"
]
},
{
Expand Down

0 comments on commit d6ab70c

Please sign in to comment.