Added code-src-note

This commit is contained in:
Dominik Moritz Roth 2022-07-01 11:52:50 +02:00
parent ab1b269af9
commit 2626ec82a6

View File

@ -3,6 +3,10 @@ from torch.distributions.multivariate_normal import _batch_mahalanobis
def mahalanobis_alt(u, v, std): def mahalanobis_alt(u, v, std):
"""
Stolen from Fabian's Code (Public Version)
"""
delta = u - v delta = u - v
return th.triangular_solve(delta, std, upper=False)[0].pow(2).sum([-2, -1]) return th.triangular_solve(delta, std, upper=False)[0].pow(2).sum([-2, -1])