Skip to content
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

about mahalanobis_distance #6

Open
ShuaiLYU opened this issue Nov 14, 2022 · 2 comments
Open

about mahalanobis_distance #6

ShuaiLYU opened this issue Nov 14, 2022 · 2 comments

Comments

@ShuaiLYU
Copy link

Hi, May I 'd like ask a question ? If I have multiple gaussion distributions and a data point x , I want to judge which distribution the x belongs to and calcualate the distance. The intuition is calculating the mahalanobis distances between x and the multiple gaussion distributions folllowed by a argmin operation. is it make sense and how to achieve it by using a quick matrix operation ?

I guess It is kind of like GMM based on mahalanobis_distance

@SimplicityApks
Copy link

Hi,
yes I'd say that intuitively makes sense. The question you ask there is more generally "how do I efficiently get the index of the gaussian in a gaussian mixture model which likely generated my sample(s)". With max likelihood estimation you directly arrive at the minimum Mahalanobis distance.
For quick matrix operation, depending on the number of times you run this and the number of samples you want to answer this for in parallel, just calling the current implementation of mahalanobis_distance iteratively for each mixture should not be too slow.

There is some possibility to optimize, but since each mixture has a different covariance matrix, formulating this in a single torch.einsum call like done in our implementation here would be difficult I suppose.

@Leonardo0325
Copy link

Hello, I would like to ask a question. Now I have found that the Gaussian distribution at certain points exhibits a double Gaussian distribution, and there may be deviations when calculating the mean and covariance. I would like to distinguish the channels that conform to the double Gaussian distribution, and then calculate the minimum Mahalanobis distance separately from the two distributions. Do you have any ideas about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants