LowRankMixture#
- class hybrid_aif.distributions.LowRankMixture[source]#
Bases:
ModuleGaussian mixture whose component covariances are diagonal plus low rank,
S_i = diag(D_i) + U_i U_iᵀ, withU_iofrcolumns in ap-dimensional space.entropy()is the Kolchinsky-Tracey pair ofMixtureGaussian.entropy(), computed without forming apbyparray: the matrix determinant lemma gives every log determinant and the Woodbury identity every trace and quadratic form, fromrbyrand2rby2rfactorisations. The cost isO(N² p r²)forNcomponents againstO(N² p³)dense.- pairwise_kl()[source]#
KL(component_i ‖ component_j), shape(..., N, N), an exact zero on the diagonal.tr(S_j⁻¹ S_i) - pis formed from the differencesD_i - D_jandΔ = U_i - U_jastr(S_j⁻¹ (D_i - D_j)) + 2 tr(X_jᵀ Δ) + tr(Δᵀ S_j⁻¹ Δ),X_j = S_j⁻¹ U_j, which is small for near-coincident components, where subtracting the two tracestr(S_j⁻¹ S_i)andploses all precision in single precision.
- pairwise_bhattacharyya()[source]#
Bhattacharyya distance between components, shape
(..., N, N), an exact zero on the diagonal.
- __init__(log_weights, means, diag, factors)#