Skip to content

Commit 461d269

Browse files
committed
doc wda
1 parent 3cc99e6 commit 461d269

File tree

1 file changed

+16
-29
lines changed

1 file changed

+16
-29
lines changed

ot/dr.py

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,41 +54,28 @@ def wda(X,y,p=2,reg=1,k=10,solver = None,maxiter=100,verbose=0):
5454
5555
Parameters
5656
----------
57-
a : np.ndarray (ns,)
58-
samples weights in the source domain
59-
b : np.ndarray (nt,)
60-
samples in the target domain
61-
M : np.ndarray (ns,nt)
62-
loss matrix
63-
reg : float
64-
Regularization term >0
65-
numItermax : int, optional
66-
Max number of iterations
67-
stopThr : float, optional
68-
Stop threshol on error (>0)
69-
verbose : bool, optional
57+
X : numpy.ndarray (n,d)
58+
Training samples
59+
y : np.ndarray (n,)
60+
labels for training samples
61+
p : int, optional
62+
size of dimensionnality reduction
63+
reg : float, optional
64+
Regularization term >0 (entropic regularization)
65+
solver : str, optional
66+
None for steepest decsent or 'TrustRegions' for trust regions algorithm
67+
else shoudl be a pymanopt.sovers
68+
verbose : int, optional
7069
Print information along iterations
71-
log : bool, optional
72-
record log if True
70+
7371
7472
7573
Returns
7674
-------
77-
gamma : (ns x nt) ndarray
75+
P : (d x p) ndarray
7876
Optimal transportation matrix for the given parameters
79-
log : dict
80-
log dictionary return only if log==True in parameters
81-
82-
Examples
83-
--------
84-
85-
>>> import ot
86-
>>> a=[.5,.5]
87-
>>> b=[.5,.5]
88-
>>> M=[[0.,1.],[1.,0.]]
89-
>>> ot.sinkhorn(a,b,M,1)
90-
array([[ 0.36552929, 0.13447071],
91-
[ 0.13447071, 0.36552929]])
77+
proj : fun
78+
projectiuon function including mean centering
9279
9380
9481
References

0 commit comments

Comments
 (0)