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

Method kl_div

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

Source from the content-addressed store, hash-verified

3289 return tf.linalg.eigh(a)
3290
3291 def kl_div(self, p, q, mass=False, eps=1e-16):
3292 value = tnp.sum(p * tnp.log(p / q + eps))
3293 if mass:
3294 value = value + tnp.sum(q - p)
3295 return value
3296
3297 def isfinite(self, a):
3298 return tnp.isfinite(a)

Callers

nothing calls this directly

Calls 2

sumMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected