-
Notifications
You must be signed in to change notification settings - Fork 1
Fisher Information metric #33
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
base: main
Are you sure you want to change the base?
Conversation
kellertuer
left a comment
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.
This is just a very short first impression – but it looks nice!
| import ExponentialFamily: exponential_family_typetag | ||
|
|
||
|
|
||
| struct ChartNOrderRetraction{Order,E} <: AbstractRetractionMethod |
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.
Is this a retraction type? Then it could subtype https://github.com/JuliaManifolds/ManifoldsBase.jl/blob/85b42907c26df0463f3fc91ba7dafd3fa534f800/src/retractions.jl#L8-L13 ?
| getdims(M::NaturalParametersManifold) = M.dims | ||
| getbase(M::NaturalParametersManifold) = M.base | ||
| getconditioner(M::NaturalParametersManifold) = M.conditioner | ||
| getmetric(M::NaturalParametersManifold) = M.metric |
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.
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 personally would prefer get_X methods, since Julia is often snake_case (ok also with counter examples like isapprox)
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.
is this maybe similar to https://juliamanifolds.github.io/Manifolds.jl/stable/manifolds/metric/#Manifolds.metric-Tuple{MetricManifold} ?
I think it’s exactly the same, thanks
| function ManifoldsBase.retract_fused!( | ||
| ::NaturalParametersManifold, q, p, X, t::Number, method::FirstOrderRetraction | ||
| ) | ||
| q .= p .+ t .* X | ||
| return q | ||
| end |
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.
This seems to indicate your retraction type atop should indeed be an AbstractRetraction subtype – and in the long run this could be documented a bit more. For me natural coordinates seemed a bit magic in the beginning ;)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
==========================================
+ Coverage 96.81% 97.31% +0.49%
==========================================
Files 25 25
Lines 345 409 +64
==========================================
+ Hits 334 398 +64
Misses 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fisher Information Metric and Second-Order Retractions for Exponential Family Manifolds
Key Features
1. Fisher Information Metric
The
FisherInformationMetrictype integrates the Fisher information matrix as a Riemannian metric for exponential family manifolds. This creates a proper geometric structure that respects the natural parameterization of exponential families.2. Retraction Methods
Two levels of retraction accuracy are implemented:
First-Order Retraction
A simple linear retraction that applies a tangent vector directly in parameter space. This is equivalent to a standard Euclidean step in the natural parameters.
Second-Order Retraction
A more sophisticated retraction that accounts for manifold curvature using Christoffel symbols. This produces a much better approximation to the true exponential map, especially for highly curved distributions.
Usage Example