-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use a new DifferentiationMethod type for specifying derivative methods #122
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #122 +/- ##
==========================================
+ Coverage 95.26% 95.86% +0.59%
==========================================
Files 17 17
Lines 380 290 -90
==========================================
- Hits 362 278 -84
+ Misses 18 12 -6 ☔ View full report in Codecov by Sentry. |
Benchmark Results
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joshua Lampert <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also export FiniteDifference
. We could also think about a backend Analytical
or similar, which computes the analytical derivative, which would currently be only supported for a BezierCurve
, but that's fine IMO. What do you think?
This is breaking because, e.g., |
Yes. I’ve been planning for this to be part of a |
Yeah, I'm fine with that 👍 |
I suspect this is simply because |
Status updateRemaining TODO:
|
That is something I haven't thought about, but it makes sense! Thanks for all the work on this, it is shaping up wonderfully. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joshua Lampert <[email protected]>
The failing Aqua test for unbound params in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few smaller suggestions and I left a question for discussion.
Co-authored-by: Joshua Lampert <[email protected]>
The latest commit fixes the unbound parameters issue, so hopefully the newfound performance improvement is also maintained. |
Looks like performance was maintained. I think we might be essentially done with this one, finally. |
The OP post has been updated with a summary of all changes. Bumping one last time for any remaining review notes/suggestions. |
Co-authored-by: Joshua Lampert <[email protected]>
Co-authored-by: Joshua Lampert <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Changes
diff_method
keyword argument to theintegral
API with a correspondingDifferentiationMethod
type set for specifying how Jacobians should be calculated.FiniteDifference{T=Float64}(T(1e-6))
requests a finite difference approximation with the provided epsilon (step size) value.Analytical()
requests usage of analytical solutions to derivatives.AutoEnzyme
andAutoZygote
, to be defined in the future.differential
andjacobian
to 3-argument:(geometry, ts, diff_method)
._has_analytical(geometry)
returns whether a geometry has a method defined forjacobian(geometry, ts, ::Analytical)
_default_method(geometry)
returns the recommended defaultDifferentiationMethod
for a geometry, currently:Analytical()
for geometries where they're defined, otherwiseFiniteDifference()
_guarantee_analytical(G, diff_method)
is a hopefully-temporary workaround that throws a descriptiveArgumentError
if_has_analytical(G)
is false. Ref Use new Parametric Geometry types for internal domain transformations #128v0.16.0-DEV
(targeting a new version number pending other PR's merging).Ref #35