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

Add second-order derivative functions #122

Merged
merged 12 commits into from
Feb 5, 2024

Conversation

gerlero
Copy link
Contributor

@gerlero gerlero commented Dec 20, 2023

Draft PR for changes discussed in JuliaDiff/ForwardDiff.jl#678

Fixes #71.

Copy link

codecov bot commented Dec 20, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (211b675) 82.94% compared to head (72e4201) 83.37%.
Report is 2 commits behind head on master.

Files Patch % Lines
src/AbstractDifferentiation.jl 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #122      +/-   ##
==========================================
+ Coverage   82.94%   83.37%   +0.42%     
==========================================
  Files           8        8              
  Lines         428      451      +23     
==========================================
+ Hits          355      376      +21     
- Misses         73       75       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gdalle
Copy link
Member

gdalle commented Dec 21, 2023

I think the change is welcome here and coherent regardless of whether it makes it into ForwardDiff. However it probably needs tests too, which I guess is why the PR remains a draft.
Thank you so much for taking the time!

@gerlero
Copy link
Contributor Author

gerlero commented Dec 21, 2023

@gdalle Thanks. Tests are now live and passing so this is ready for review

@gerlero gerlero marked this pull request as ready for review December 21, 2023 16:16
@gerlero
Copy link
Contributor Author

gerlero commented Jan 2, 2024

Gentle bump @gdalle; can you be a reviewer in this PR?

Copy link
Member

@gdalle gdalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!
The backend-agnostic part looks good to me. I would have to read up on ForwardDiff tags to understand what you did in the relevant extension, so if someone else can review that part great, if not I'll do it too.
Any reason why you didn't add tests for Tracker and RuleConfig backends?

docs/src/implementer_guide.md Show resolved Hide resolved
docs/src/implementer_guide.md Outdated Show resolved Hide resolved
ext/AbstractDifferentiationForwardDiffExt.jl Show resolved Hide resolved
ext/AbstractDifferentiationForwardDiffExt.jl Show resolved Hide resolved
ext/AbstractDifferentiationForwardDiffExt.jl Outdated Show resolved Hide resolved
ext/AbstractDifferentiationForwardDiffExt.jl Outdated Show resolved Hide resolved
ext/AbstractDifferentiationForwardDiffExt.jl Outdated Show resolved Hide resolved
src/AbstractDifferentiation.jl Outdated Show resolved Hide resolved
@gerlero
Copy link
Contributor Author

gerlero commented Jan 3, 2024

@gdalle @devmotion Thanks for the reviews.

Any reason why you didn't add tests for Tracker and RuleConfig backends?

I simply omitted them because I saw that those backends don't have tests for hessian either. I've now tried adding the tests: RuleConfig passes, but Tracker fails (ArgumentError: Tracker backend does not support nested differentiation.). So, I've now added the RuleConfig backend tests, but left Tracker out.

EDIT: the RuleConfig tests fail with Julia nightly though..

@gdalle
Copy link
Member

gdalle commented Feb 2, 2024

As soon as I understand what's going on with the tags, it's good to merge on my end

test/test_utils.jl Outdated Show resolved Hide resolved
test/test_utils.jl Outdated Show resolved Hide resolved
test/test_utils.jl Outdated Show resolved Hide resolved
test/test_utils.jl Outdated Show resolved Hide resolved
test/test_utils.jl Outdated Show resolved Hide resolved
test/test_utils.jl Outdated Show resolved Hide resolved
test/test_utils.jl Outdated Show resolved Hide resolved
src/AbstractDifferentiation.jl Outdated Show resolved Hide resolved
src/AbstractDifferentiation.jl Outdated Show resolved Hide resolved
src/AbstractDifferentiation.jl Outdated Show resolved Hide resolved
@gdalle gdalle merged commit ac1d573 into JuliaDiff:master Feb 5, 2024
7 checks passed
@gerlero
Copy link
Contributor Author

gerlero commented Feb 5, 2024

Thanks. Can we get a new release with this feature?

@devmotion
Copy link
Member

JuliaRegistries/General#100271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing value_derivative_and_second_derivative?
3 participants