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.
As per the formulae given in the paper
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 117X
) but as per formulae you calculate the covariance for each class and then take the average. So I feel that we should applysklearn.covariance.EmpiricalCovariance
per class and then take the sum.Thanks,