Skip to content

Conversation

@moble
Copy link
Contributor

@moble moble commented Nov 19, 2024

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Going through the new example, I saw that the gradient returned (nothing,); checked with ForwardDiff and got all zeros; then just looked at the function value with different inputs, to see that it was indeed identical. It's hard to see this kind of mistake, but the newprob was never actually used; it just re-solved the original problem every time. With this change, I obtain consistent gradients with Zygote, ForwardDiff, and even FiniteDiff.

@ChrisRackauckas ChrisRackauckas merged commit 7a64c09 into SciML:main Nov 19, 2024
@ChrisRackauckas
Copy link
Member

Thanks!

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