Skip to content

Commit 2eaee96

Browse files
committed
add doc and correct encoding
1 parent 3797781 commit 2eaee96

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

ot/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
"""Python Optimal Transport toolbox"""
1+
"""Python Optimal Transport toolbox
2+
3+
4+
5+
"""
26

37

48
# All submodules and packages

ot/bregman.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,11 @@ def geometricMean(alldistribT):
508508
return np.exp(np.mean(np.log(alldistribT),axis=1))
509509

510510
def projR(gamma,p):
511-
#return np.dot(np.diag(p/np.maximum(np.sum(gamma,axis=1),1e-10)),gamma)
511+
"""return the KL projection on the row constrints """
512512
return np.multiply(gamma.T,p/np.maximum(np.sum(gamma,axis=1),1e-10)).T
513513

514514
def projC(gamma,q):
515-
#return (np.dot(np.diag(q/np.maximum(np.sum(gamma,axis=0),1e-10)),gamma.T)).T
515+
"""return the KL projection on the column constrints """
516516
return np.multiply(gamma,q/np.maximum(np.sum(gamma,axis=0),1e-10))
517517

518518

ot/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ def dist(x1,x2=None,metric='sqeuclidean'):
6363
matrix with n2 samples of size d (if None then x2=x1)
6464
metric : str, fun, optional
6565
name of the metric to be computed (full list in the doc of scipy), If a string,
66-
the distance function can be braycurtis’, ‘canberra’, ‘chebyshev’, ‘cityblock,
67-
correlation’, ‘cosine’, ‘dice’, ‘euclidean’, ‘hamming’, ‘jaccard’, ‘kulsinski,
68-
mahalanobis’, ‘matching’, ‘minkowski’, ‘rogerstanimoto’, ‘russellrao’, ‘seuclidean,
69-
sokalmichener’, ‘sokalsneath’, ‘sqeuclidean’, ‘wminkowski’, ‘yule.
66+
the distance function can be 'braycurtis', 'canberra', 'chebyshev', 'cityblock',
67+
'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jaccard', 'kulsinski',
68+
'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean',
69+
'sokalmichener', 'sokalsneath', 'sqeuclidean', 'wminkowski', 'yule'.
7070
7171
7272
Returns

0 commit comments

Comments
 (0)