summaryrefslogtreecommitdiff
path: root/src/python/gudhi/wasserstein/wasserstein.py
diff options
context:
space:
mode:
authortlacombe <lacombe1993@gmail.com>2021-04-12 10:45:32 +0200
committertlacombe <lacombe1993@gmail.com>2021-04-12 10:45:32 +0200
commit89bb3d11064de40f2b4fda958aa2e2e8cfa5b489 (patch)
tree4d45c80f2e4c799a3db8575789e7f96378091548 /src/python/gudhi/wasserstein/wasserstein.py
parent69341c88c7c7819656c9a9b935fecc3bea50e4af (diff)
change name _offdiag to _finite_part
Diffstat (limited to 'src/python/gudhi/wasserstein/wasserstein.py')
-rw-r--r--src/python/gudhi/wasserstein/wasserstein.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/python/gudhi/wasserstein/wasserstein.py b/src/python/gudhi/wasserstein/wasserstein.py
index 572d4249..d64d433e 100644
--- a/src/python/gudhi/wasserstein/wasserstein.py
+++ b/src/python/gudhi/wasserstein/wasserstein.py
@@ -175,11 +175,11 @@ def _handle_essential_parts(X, Y, order):
return c, np.array(m)
-def _offdiag(X, enable_autodiff):
+def _finite_part(X, enable_autodiff):
'''
:param X: (n x 2) numpy array encoding a persistence diagram.
:param enable_autodiff: boolean, to handle the case where X is a eagerpy tensor.
- :returns: The off-diagonal part of a diagram `X` (points with finite coordinates).
+ :returns: The finite part of a diagram `X` (points with finite coordinates).
'''
if enable_autodiff:
# Assumes the diagrams only have finite coordinates. Thus, return X directly.
@@ -262,13 +262,13 @@ def wasserstein_distance(X, Y, matching=False, order=1., internal_p=np.inf, enab
essential_cost = 0
essential_matching = None
- # Extract off-diaognal points of the diagrams. Note that if enable_autodiff is True, nothing is done here (X,Y are
+ # Extract finite points of the diagrams. Note that if enable_autodiff is True, nothing is done here (X,Y are
# assumed to be tensors with only finite coordinates).
- X, Y = _offdiag(X, enable_autodiff), _offdiag(Y, enable_autodiff)
+ X, Y = _finite_part(X, enable_autodiff), _finite_part(Y, enable_autodiff)
n = len(X)
m = len(Y)
- # Now the standard pipeline for off-diagonal parts
+ # Now the standard pipeline for finite parts
if enable_autodiff:
import eagerpy as ep