Closed devmotion closed 1 year ago
Patch coverage: 100.00%
and project coverage change: -1.30%
:warning:
Comparison is base (
3c18e86
) 84.12% compared to head (4c55550
) 82.82%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'm strongly in favor of more simplicity at the expense of a little performance. I think there might be a conflict with #93 though, gonna try to do the merge
Ah, missed that there's a merge conflict. I'll fix it.
The merge conflicts are fixed, the PR is ready for review 🙂
IMO the AbstractFiniteDifference special cases in the default definitions are confusing (see #94...) and lead to code that is less idiomatic and more difficult to optimize.
With increasing dimensionality, avoiding one additional computation of the primal matters less and less, and hence this PR proposes to disentangle the computation of the primal and the jacobian/Hessian/etc. Moreover, also with these changes one can improve performance for individual backends, if possible and desired, by defining a more optimized
value_and_jacobian
etc.An additional advantage for higher-order calls
value_and_hessian
andvalue_gradient_and_hessian
is that it is sufficient to callgradient
instead ofvalue_and_gradient
.