deep_Mahalanobis_detector icon indicating copy to clipboard operation
deep_Mahalanobis_detector copied to clipboard

How to calculate tied covariance matrix

Open lumliolum opened this issue 1 year ago • 0 comments

As per the formulae given in the paper

image

which is equalivalent to calculate the covaraince matrix for each class and then take the weighted average to get the tied covariance matrix. But in the code, https://github.com/pokaxpoka/deep_Mahalanobis_detector/blob/90c2105e78c6f76a2801fc4c1cb1b84f4ff9af63/lib_generation.py#L107-L120

you are using sklearn.covariance.EmpiricalCovariance for all of the data (see line 117 X) but as per formulae you calculate the covariance for each class and then take the average. So I feel that we should apply sklearn.covariance.EmpiricalCovariance per class and then take the sum.

Thanks,

lumliolum avatar Apr 19 '23 20:04 lumliolum