-
Notifications
You must be signed in to change notification settings - Fork 1
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 natural gamma manifold #26
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
==========================================
+ Coverage 96.69% 97.28% +0.58%
==========================================
Files 25 28 +3
Lines 333 405 +72
==========================================
+ Hits 322 394 +72
Misses 11 11 ☔ View full report in Codecov by Sentry. |
A more generic implementation of Christoffel symbol. function christoffel(::Type{D}, ::NaturalParametersSpace, η) where D
# Pre-compute values used multiple times
ef = ExponentialFamilyDistribution(D, η, nothing)
G = fisherinformation(ef)
G⁻¹ = cholinv(G)
dG = partial_metric(D, NaturalParametersSpace(), η)
T = eltype(G) # Get the element type from G
# Pre-allocate output array
rep_size = sum(representation_size(get_natural_manifold(D, size(η))))
Γ = zeros(T, rep_size, rep_size, rep_size)
# Pre-compute the sum of dG terms
dG_sum = similar(dG)
@tensor begin
dG_sum[ℓ,j,i] = dG[ℓ,j,i] + dG[ℓ,i,j] - dG[i,j,ℓ]
end
# Use tensor operations with pre-computed sum
@tensor begin
Γ[k,i,j] = T(0.5) * G⁻¹[k,ℓ] * dG_sum[ℓ,j,i]
end
return Γ
end |
Is there an ETA on this one? |
@ismailsenoz I think there are nuances, but more or less all things are addressed. I don't want to change the partial code for now, I will think about how to do it properly when I address a review for Juliacon, implementing all ideas from this PR but generically for all exponential families. |
No description provided.