-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 warning about change of sign in hessian functions #6312
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6312 +/- ##
==========================================
- Coverage 76.04% 76.03% -0.02%
==========================================
Files 95 95
Lines 16181 16189 +8
==========================================
+ Hits 12305 12309 +4
- Misses 3876 3880 +4
|
I opted to something like this when we changed the sign of an operation before: Lines 308 to 331 in 4acd98e
If this is critical enough, we can do the same for the output of the hessian. And later on deprecate the kwarg |
Without understanding much context, as a geometer I must warn that a common sign convention for the Hessian in geometry and physics is indeed negative nabla-squared. The reason for this is that it makes the Hessian positive semi-definite on plane-waves of the form Nerd rant over. 🤓 |
@maresb I think that keeping it in line with PyTensor is a good reason enough? @aseyboldt I added a FutureWarning that can be disabled with |
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.
Given that the typical user of PyMC isn't a differential geometer, I approve of this approach. I like @ricardoV94's deprecation plan
I'm still a bit 🤯 that this appears to be an accidental(?) rediscovery of the geometer's convention for the Laplacian. Although perhaps not too surprising, since when considering Bayesian stats as real-valued quantum mechanics, the minus sign that makes -logp positive-ish is the same minus sign that geometers like since it gives a positive spectrum.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6312 +/- ##
===========================================
- Coverage 91.24% 76.03% -15.21%
===========================================
Files 102 95 -7
Lines 17090 16189 -901
===========================================
- Hits 15593 12309 -3284
- Misses 1497 3880 +2383
|
The hessian function incorrectly returned the negative of the hessian.
This does change the output of
Model.d2logp
however, so we should mention this in the release notes.Major / Breaking Changes
Sign of the hessian is fixed, and therefore different than before
Fixes #6310