Skip to content

Commit f8f298d

Browse files
Update _gw.py (#637)
doc typos Co-authored-by: Cédric Vincent-Cuaz <cedvincentcuaz@gmail.com>
1 parent aa4f370 commit f8f298d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

ot/gromov/_gw.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ def gromov_wasserstein(C1, C2, p=None, q=None, loss_fun='square_loss', symmetric
4343
4444
Where :
4545
46-
- :math:`\mathbf{C_1}`: Metric cost matrix in the source space
47-
- :math:`\mathbf{C_2}`: Metric cost matrix in the target space
48-
- :math:`\mathbf{p}`: distribution in the source space
49-
- :math:`\mathbf{q}`: distribution in the target space
50-
- `L`: loss function to account for the misfit between the similarity matrices
46+
- :math:`\mathbf{C_1}`: Metric cost matrix in the source space.
47+
- :math:`\mathbf{C_2}`: Metric cost matrix in the target space.
48+
- :math:`\mathbf{p}`: Distribution in the source space.
49+
- :math:`\mathbf{q}`: Distribution in the target space.
50+
- `L`: Loss function to account for the misfit between the similarity matrices.
5151
5252
.. note:: This function is backend-compatible and will work on arrays
5353
from all compatible backends. But the algorithm uses the C++ CPU backend
@@ -62,39 +62,39 @@ def gromov_wasserstein(C1, C2, p=None, q=None, loss_fun='square_loss', symmetric
6262
Parameters
6363
----------
6464
C1 : array-like, shape (ns, ns)
65-
Metric cost matrix in the source space
65+
Metric cost matrix in the source space.
6666
C2 : array-like, shape (nt, nt)
67-
Metric cost matrix in the target space
67+
Metric cost matrix in the target space.
6868
p : array-like, shape (ns,), optional
6969
Distribution in the source space.
7070
If let to its default value None, uniform distribution is taken.
7171
q : array-like, shape (nt,), optional
7272
Distribution in the target space.
7373
If let to its default value None, uniform distribution is taken.
7474
loss_fun : str, optional
75-
loss function used for the solver either 'square_loss' or 'kl_loss'
75+
Loss function used for the solver either 'square_loss' or 'kl_loss'.
7676
symmetric : bool, optional
7777
Either C1 and C2 are to be assumed symmetric or not.
7878
If let to its default None value, a symmetry test will be conducted.
7979
Else if set to True (resp. False), C1 and C2 will be assumed symmetric (resp. asymmetric).
8080
verbose : bool, optional
81-
Print information along iterations
81+
Print information along iterations.
8282
log : bool, optional
83-
record log if True
83+
Record log if True.
8484
armijo : bool, optional
85-
If True the step of the line-search is found via an armijo research. Else closed form is used.
86-
If there are convergence issues use False.
85+
If True, the step of the line-search is found via an armijo search. Else closed form is used.
86+
If there are convergence issues, use False.
8787
G0: array-like, shape (ns,nt), optional
88-
If None the initial transport plan of the solver is pq^T.
88+
If None, the initial transport plan of the solver is pq^T.
8989
Otherwise G0 must satisfy marginal constraints and will be used as initial transport of the solver.
9090
max_iter : int, optional
91-
Max number of iterations
91+
Max number of iterations.
9292
tol_rel : float, optional
93-
Stop threshold on relative error (>0)
93+
Stop threshold on relative error (>0).
9494
tol_abs : float, optional
95-
Stop threshold on absolute error (>0)
95+
Stop threshold on absolute error (>0).
9696
**kwargs : dict
97-
parameters can be directly passed to the ot.optim.cg solver
97+
Parameters can be directly passed to the ot.optim.cg solver.
9898
9999
Returns
100100
-------
@@ -175,7 +175,7 @@ def line_search(cost, G, deltaG, Mi, cost_G, **kwargs):
175175

176176
if not nx.is_floating_point(C10):
177177
warnings.warn(
178-
"Input structure matrix consists of integer. The transport plan will be "
178+
"Input structure matrix consists of integers. The transport plan will be "
179179
"casted accordingly, possibly resulting in a loss of precision. "
180180
"If this behaviour is unwanted, please make sure your input "
181181
"structure matrix consists of floating point elements.",

0 commit comments

Comments
 (0)