Skip to content

Commit 3ba85d6

Browse files
committed
doc update
1 parent 8ff51eb commit 3ba85d6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ot/dr.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
from pymanopt.solvers import SteepestDescent, TrustRegions
1010

1111
def dist(x1,x2):
12-
""" Compute squared euclidean distance between samples
12+
""" Compute squared euclidean distance between samples (autograd)
1313
"""
1414
x1p2=np.sum(np.square(x1),1)
1515
x2p2=np.sum(np.square(x2),1)
1616
return x1p2.reshape((-1,1))+x2p2.reshape((1,-1))-2*np.dot(x1,x2.T)
1717

1818
def sinkhorn(w1,w2,M,reg,k):
19-
"""
20-
Simple solver for Sinkhorn algorithm with fixed number of iteration
19+
"""Sinkhorn algorithm with fixed number of iteration (autograd)
2120
"""
2221
K=np.exp(-M/reg)
2322
ui=np.ones((M.shape[0],))
@@ -29,8 +28,7 @@ def sinkhorn(w1,w2,M,reg,k):
2928
return G
3029

3130
def split_classes(X,y):
32-
"""
33-
split samples in X by classes in y
31+
"""split samples in X by classes in y
3432
"""
3533
lstsclass=np.unique(y)
3634
return [X[y==i,:].astype(np.float32) for i in lstsclass]

0 commit comments

Comments
 (0)