0

I want to implement the covariance of training samples, which can be used when calculating the Mahalanobis distance. How can I implement this equation in Python?

I referenced that image in 'A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attacks'.

enter image description here

nnnmmm
  • 7,964
  • 4
  • 22
  • 41
모하니
  • 11
  • 3
  • Welcome to SO. What have you tried so far? – natn2323 May 04 '19 at 17:42
  • in that image, u(c) is is the mean of multivariate Gaussian distribution of class c and f(x) denotes the output of the penultimate layer of DNNs. i want to know how can i calculate the inverse of the covariance of training samples but the determinant is 0, so i can't proceed. How can I calculate the inverse of that image covariance ? – 모하니 May 05 '19 at 10:16

0 Answers0