Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.markdown to reflect changes in an earlier commit. #31

Merged
merged 1 commit into from
Jan 12, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ inspect lazily. Somewhat more intuitive answers can be obtained by converting th

The answer:

Prelude Numeric.AD> headJet $ tensors $ grads (\[x,y] -> exp (x * y)) [1,2]
Prelude Numeric.AD Numeric.AD.Types> headJet $ jet $ grads (\[x,y] -> exp (x * y)) [1,2]
7.38905609893065

The gradient:

Prelude Numeric.AD> headJet $ tailJet $ tensors $ grads (\[x,y] -> exp (x * y)) [1,2]
Prelude Numeric.AD Numeric.AD.Types> headJet $ tailJet $ jet $ grads (\[x,y] -> exp (x * y)) [1,2]
[14.7781121978613,7.38905609893065]

The hessian (n * n matrix of 2nd derivatives)

Prelude Numeric.AD> headJet $ tailJet $ tailJet $ tensors $ grads (\[x,y] -> exp (x * y)) [1,2]
Prelude Numeric.AD Numeric.AD.Types> headJet $ tailJet $ tailJet $ jet $ grads (\[x,y] -> exp (x * y)) [1,2]
[[29.5562243957226,22.16716829679195],[22.16716829679195,7.38905609893065]]

Or even higher order tensors of derivatives.

Prelude Numeric.AD> headJet $ tailJet $ tailJet $ tailJet $ tensors $ grads (\[x,y] -> exp (x * y)) [1,2]
Prelude Numeric.AD Numeric.AD.Types> headJet $ tailJet $ tailJet $ tailJet $ jet $ grads (\[x,y] -> exp (x * y)) [1,2]
[[[59.1124487914452,44.3343365935839],[44.3343365935839,14.7781121978613]],[[44.3343365935839,14.7781121978613],[14.7781121978613,7.38905609893065]]]

Note the redundant values caused by the various symmetries in the tensors. The `ad` library is careful to compute
Expand Down