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

Automatic differentiation for primitives #311

Merged
merged 38 commits into from
Dec 6, 2023

Conversation

shoubhikraj
Copy link
Collaborator

Replaces hand-coded derivatives for primitive internals with automatic differentiation so that upto second derivatives can be calculated for any primitive.


Checklist

  • The changes include an associated explanation of how/why
  • Test pass
  • Documentation has been updated
  • Changelog has been updated

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

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

Comparison is base (c4a0211) 97.37% compared to head (61f93f0) 97.40%.

Files Patch % Lines
autode/opt/coordinates/_autodiff.py 98.29% 5 Missing ⚠️
autode/opt/optimisers/crfo.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           v1.4.2     #311      +/-   ##
==========================================
+ Coverage   97.37%   97.40%   +0.03%     
==========================================
  Files         206      208       +2     
  Lines       23048    23451     +403     
==========================================
+ Hits        22443    22843     +400     
- Misses        605      608       +3     
Flag Coverage Δ
unittests 97.40% <98.92%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@shoubhikraj shoubhikraj marked this pull request as ready for review November 25, 2023 20:50
@shoubhikraj shoubhikraj self-assigned this Nov 25, 2023
@t-young31
Copy link
Member

from a quick scroll this looks (a) awesome and (b) like it doesn't change any of the public API, so suitable for a patch release? if so, I'll push a blank v1.4.2 branch and it can target that

autode/opt/coordinates/internals.py Outdated Show resolved Hide resolved
autode/opt/coordinates/internals.py Outdated Show resolved Hide resolved
autode/opt/coordinates/internals.py Show resolved Hide resolved
autode/opt/coordinates/primitives.py Outdated Show resolved Hide resolved
autode/opt/coordinates/primitives.py Outdated Show resolved Hide resolved
autode/opt/coordinates/primitives.py Show resolved Hide resolved
autode/opt/coordinates/primitives.py Show resolved Hide resolved
autode/opt/coordinates/primitives.py Show resolved Hide resolved
autode/opt/coordinates/primitives.py Outdated Show resolved Hide resolved
autode/opt/coordinates/primitives.py Show resolved Hide resolved
Copy link
Member

@t-young31 t-young31 left a comment

Choose a reason for hiding this comment

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

love it. left a few comments – nothing major

autode/opt/coordinates/autodiff.py Outdated Show resolved Hide resolved
autode/opt/coordinates/autodiff.py Outdated Show resolved Hide resolved
autode/opt/coordinates/autodiff.py Outdated Show resolved Hide resolved
autode/opt/coordinates/autodiff.py Outdated Show resolved Hide resolved
autode/opt/coordinates/autodiff.py Outdated Show resolved Hide resolved
autode/opt/coordinates/autodiff.py Outdated Show resolved Hide resolved
autode/opt/coordinates/autodiff.py Outdated Show resolved Hide resolved
autode/opt/coordinates/autodiff.py Outdated Show resolved Hide resolved
@shoubhikraj
Copy link
Collaborator Author

@t-young31 Thank you! Yes, the modification should not change the public api, so it should be ok for patch release.

@shoubhikraj shoubhikraj changed the title Better derivatives for primitives Automatic differentiation for primitives Dec 3, 2023
@t-young31 t-young31 changed the base branch from master to v1.4.2 December 3, 2023 15:53
@t-young31
Copy link
Member

have changed the base to v1.4.2. would you mind adding something to the changelog? cheers 😄

Copy link
Member

@t-young31 t-young31 left a comment

Choose a reason for hiding this comment

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

feel free to merge after the changelog update 🚀

@shoubhikraj
Copy link
Collaborator Author

@t-young31 Could you please have one last check before merge?

Copy link
Member

@t-young31 t-young31 left a comment

Choose a reason for hiding this comment

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

❤️

@shoubhikraj shoubhikraj merged commit 3199ba5 into duartegroup:v1.4.2 Dec 6, 2023
17 checks passed
@shoubhikraj shoubhikraj deleted the autodiff-add branch December 6, 2023 19:14
This pull request was closed.
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.

2 participants