You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GaussianMixture.mixture_parameters_to_gaussian_parameters() accepted means and covariance tensors without verifying that both described the same component set.
For example, two scalar component means and two weights could be combined with only one covariance matrix. NumPy-style broadcasting duplicated that single covariance across the component axis and returned a plausible Gaussian instead of reporting incomplete mixture data. A covariance matrix with no component axis could be broadcast similarly.
Fix
normalize the public means and covariance inputs to backend arrays before structural validation;
accept scalar-component means shaped (n_components,) and vector-component means shaped (n_components, state_dim);
require at least one nonempty component mean;
require covariance tensors to have the exact shape (state_dim, state_dim, n_components) before weighting;
preserve the existing weight normalization and moment-matching calculation for valid inputs.
Regression coverage
reject two means supplied with only one scalar covariance;
reject a multidimensional covariance matrix that omits the component axis;
verify matching scalar-component inputs still produce mean 1.5 and covariance 3.25.
Validation
branch is 2 commits ahead and 0 behind current main;
final diff is limited to the Gaussian-mixture implementation and one focused regression module;
full backend, test, lint, documentation, packaging, and security validation is delegated to GitHub Actions.
📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
Closing as superseded by #5238. Both change GaussianMixture.mixture_parameters_to_gaussian_parameters, but #5238 fixes the same component/covariance shape bug while preserving valid scalar, 1-D, and single-component (dim, dim) covariance shorthands. Keeping both would create overlapping, incompatible implementations and duplicate regression coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
GaussianMixture.mixture_parameters_to_gaussian_parameters()accepted means and covariance tensors without verifying that both described the same component set.For example, two scalar component means and two weights could be combined with only one covariance matrix. NumPy-style broadcasting duplicated that single covariance across the component axis and returned a plausible Gaussian instead of reporting incomplete mixture data. A covariance matrix with no component axis could be broadcast similarly.
Fix
(n_components,)and vector-component means shaped(n_components, state_dim);(state_dim, state_dim, n_components)before weighting;Regression coverage
1.5and covariance3.25.Validation
main;