ott
ott copied to clipboard
Euclidean / SqEuclidean and changes in power
This refers to issue #156.
This PR introduces a few changes:
- old
Euclidean
is moved toSqEuclidean
and continues wokring with naive **2 and vdot -
Euclidean
is now thejnp.linalg.norm(x-y)
and is properly differentiated. -
power=1.0
becomes the new default inPointCloud
(which is a lot more coherent!). - Expose
cost_fn
inPointCloud
(I think this should be visible, and useful to debug for instance)
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Codecov Report
Merging #157 (c863521) into main (b060e2c) will decrease coverage by
5.87%
. The diff coverage is72.00%
.
Additional details and impacted files
@@ Coverage Diff @@
## main #157 +/- ##
==========================================
- Coverage 89.84% 83.96% -5.88%
==========================================
Files 51 51
Lines 5061 5065 +4
Branches 518 519 +1
==========================================
- Hits 4547 4253 -294
- Misses 390 660 +270
- Partials 124 152 +28
Impacted Files | Coverage Δ | |
---|---|---|
ott/core/potentials.py | 82.35% <ø> (-4.71%) |
:arrow_down: |
ott/tools/k_means.py | 92.54% <0.00%> (-3.11%) |
:arrow_down: |
ott/tools/segment_sinkhorn.py | 43.75% <ø> (-56.25%) |
:arrow_down: |
ott/tools/sinkhorn_divergence.py | 61.81% <ø> (-32.73%) |
:arrow_down: |
ott/geometry/pointcloud.py | 68.62% <64.70%> (-15.25%) |
:arrow_down: |
ott/core/bar_problems.py | 74.57% <100.00%> (-9.61%) |
:arrow_down: |
ott/geometry/costs.py | 96.51% <100.00%> (+0.08%) |
:arrow_up: |
ott/geometry/grid.py | 89.65% <100.00%> (-0.87%) |
:arrow_down: |
ott/core/discrete_barycenter.py | 15.58% <0.00%> (-70.13%) |
:arrow_down: |
... and 28 more |