summaryrefslogtreecommitdiff
path: root/ot/bregman.py
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2017-06-09 13:18:04 +0200
committerRémi Flamary <remi.flamary@gmail.com>2017-06-09 13:18:04 +0200
commit2eaee96a2a927476cbd8ca31754a89afd0825916 (patch)
tree5cdb941f861400e8d3aa46df36926e8da1df9fb7 /ot/bregman.py
parent37977810ab538fe461ef8f3ec16434c59f6f7c5a (diff)
add doc and correct encoding
Diffstat (limited to 'ot/bregman.py')
-rw-r--r--ot/bregman.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ot/bregman.py b/ot/bregman.py
index c46e5dc..00dca88 100644
--- a/ot/bregman.py
+++ b/ot/bregman.py
@@ -508,11 +508,11 @@ def geometricMean(alldistribT):
return np.exp(np.mean(np.log(alldistribT),axis=1))
def projR(gamma,p):
- #return np.dot(np.diag(p/np.maximum(np.sum(gamma,axis=1),1e-10)),gamma)
+ """return the KL projection on the row constrints """
return np.multiply(gamma.T,p/np.maximum(np.sum(gamma,axis=1),1e-10)).T
def projC(gamma,q):
- #return (np.dot(np.diag(q/np.maximum(np.sum(gamma,axis=0),1e-10)),gamma.T)).T
+ """return the KL projection on the column constrints """
return np.multiply(gamma,q/np.maximum(np.sum(gamma,axis=0),1e-10))