From 2eaee96a2a927476cbd8ca31754a89afd0825916 Mon Sep 17 00:00:00 2001 From: Rémi Flamary Date: Fri, 9 Jun 2017 13:18:04 +0200 Subject: add doc and correct encoding --- ot/__init__.py | 6 +++++- ot/bregman.py | 4 ++-- ot/utils.py | 8 ++++---- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'ot') diff --git a/ot/__init__.py b/ot/__init__.py index 13abcda..b2af88b 100644 --- a/ot/__init__.py +++ b/ot/__init__.py @@ -1,4 +1,8 @@ -"""Python Optimal Transport toolbox""" +"""Python Optimal Transport toolbox + + + +""" # All submodules and packages 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)) diff --git a/ot/utils.py b/ot/utils.py index e5cd6c0..fc6b0d2 100644 --- a/ot/utils.py +++ b/ot/utils.py @@ -63,10 +63,10 @@ def dist(x1,x2=None,metric='sqeuclidean'): matrix with n2 samples of size d (if None then x2=x1) metric : str, fun, optional name of the metric to be computed (full list in the doc of scipy), If a string, - the distance function can be ‘braycurtis’, ‘canberra’, ‘chebyshev’, ‘cityblock’, - ‘correlation’, ‘cosine’, ‘dice’, ‘euclidean’, ‘hamming’, ‘jaccard’, ‘kulsinski’, - ‘mahalanobis’, ‘matching’, ‘minkowski’, ‘rogerstanimoto’, ‘russellrao’, ‘seuclidean’, - ‘sokalmichener’, ‘sokalsneath’, ‘sqeuclidean’, ‘wminkowski’, ‘yule’. + the distance function can be 'braycurtis', 'canberra', 'chebyshev', 'cityblock', + 'correlation', 'cosine', 'dice', 'euclidean', 'hamming', 'jaccard', 'kulsinski', + 'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', + 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'wminkowski', 'yule'. Returns -- cgit v1.2.3