summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Cassereau <84033440+ncassereau-idris@users.noreply.github.com>2022-12-03 22:44:41 +0100
committerGitHub <noreply@github.com>2022-12-03 22:44:41 +0100
commitac830dd2b85cfd39f4fadd879a721b36ded033ea (patch)
tree8a013c1bf3016bb950294d1707a0da4a54ba0564
parentfa0d4f2afff73284f4b79bfebb085eed332c112f (diff)
[MRG] Wrong documentation in weak OT solver (#410)
* Docstrings of weak.py updated * releases.md
-rw-r--r--RELEASES.md1
-rw-r--r--ot/weak.py6
2 files changed, 5 insertions, 2 deletions
diff --git a/RELEASES.md b/RELEASES.md
index 564fd4a..68487e8 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -26,6 +26,7 @@ roughly 2^31) (PR #381)
- Added a work-around for scipy's bug, where you cannot compute the Hamming distance with a "None" weight attribute. (Issue #400, PR #402)
- Fixed an issue where the doc could not be built due to some changes in matplotlib's API (Issue #403, PR #402)
- Replaced Numpy C Compiler with Setuptools C Compiler due to deprecation issues (Issue #408, PR #409)
+- Fixed weak optimal transport docstring (Issue #404, PR #410)
## 0.8.2
diff --git a/ot/weak.py b/ot/weak.py
index f7d5b23..7364e68 100644
--- a/ot/weak.py
+++ b/ot/weak.py
@@ -18,7 +18,7 @@ def weak_optimal_transport(Xa, Xb, a=None, b=None, verbose=False, log=False, G0=
.. math::
- \gamma = \mathop{\arg \min}_\gamma \quad \|X_a-diag(1/a)\gammaX_b\|_F^2
+ \gamma = \mathop{\arg \min}_\gamma \quad \sum_i \mathbf{a}_i \left(\mathbf{X^a}_i - \frac{1}{\mathbf{a}_i} \sum_j \gamma_{ij} \mathbf{X^b}_j \right)^2
s.t. \ \gamma \mathbf{1} = \mathbf{a}
@@ -28,7 +28,7 @@ def weak_optimal_transport(Xa, Xb, a=None, b=None, verbose=False, log=False, G0=
where :
- - :math:`X_a` :math:`X_b` are the sample matrices.
+ - :math:`X^a` and :math:`X^b` are the sample matrices.
- :math:`\mathbf{a}` and :math:`\mathbf{b}` are the sample weights
@@ -49,6 +49,8 @@ def weak_optimal_transport(Xa, Xb, a=None, b=None, verbose=False, log=False, G0=
Source histogram (uniform weight if empty list)
b : (nt,) array-like, float
Target histogram (uniform weight if empty list))
+ G0 : (ns,nt) array-like, float
+ initial guess (default is indep joint density)
numItermax : int, optional
Max number of iterations
numItermaxEmd : int, optional