MCPcopy Create free account
hub / github.com/PythonOT/POT / kl_div

Method kl_div

ot/backend.py:1423–1427  ·  view source on GitHub ↗
(self, p, q, mass=False, eps=1e-16)

Source from the content-addressed store, hash-verified

1421 return np.linalg.eigh(a)
1422
1423 def kl_div(self, p, q, mass=False, eps=1e-16):
1424 value = np.sum(p * np.log(p / q + eps))
1425 if mass:
1426 value = value + np.sum(q - p)
1427 return value
1428
1429 def isfinite(self, a):
1430 return np.isfinite(a)

Callers

nothing calls this directly

Calls 2

sumMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected