Incorrect initialization of GaussianMixture
from precisions_init
in the _initialize
method
#26415
Labels
10000
GaussianMixture
from precisions_init
in the _initialize
method
#26415
Describe the bug
When passing
precisions_init
to aGaussianMixture
model, a user expects to resume training the model from the provided precision matrices, which is done by calculating theprecisions_cholesky_
fromprecisions_init
in the _initialize method and continuing EM iterations from there. However, the code is not correct in the _initialize method when thecovariance_type
isfull
ortied
.In an _m_step, the$\Sigma$ by the _compute_precision_cholesky method. In particular, the $\Lambda$ can decomposed as:
precisions_cholesky_
is calculated from thecovariances_
precisions_
Given the covariance matrix$\Sigma$ , applying the Cholesky decomposition to it gives rise to a lower-triangular matrix $L$ , and then we use back-substitution to calculate $L^{-1}$ from $L$ , and finally the $U=(L^{-1})^{T}$ , which is an upper-triangular matrix $U$ . This is correct for calculating
precisions_cholesky_
can be calculated fromprecisions_cholesky_
fromcovariances_
.However, when resuming training, the _initialize method calculates$UU^{T}$ decomposition. The correct math to do so is to first apply a similarity transformation to the $\Lambda$ by an exchange matrix $J$ and then the Cholesky decomposition to the transformed $\Lambda$ . In particular, the decomposition can be expressed as:
precisions_cholesky_
fromprecisions_init
by directly conducting the Cholesky decomposition ofprecisions_init
, which is not correct. The error can be simply verified by the fact that the resultantprecisions_cholesky_
is a lower-triangular matrix which should be an upper-triangular matrix. In fact, what we need is aprecisions_init
Finally, the$U$ can be calculated as $J\tilde{L}J$ . It is noted that we've taken advantage of the property of $J$ that $J=J^{-1}=J^{T}$ .
precisions_cholesky_
Steps/Code to Reproduce
Expected Results
Actual Results
Versions
The text was updated successfully, but these errors were encountered: