[WIP] BSP-OT: Sparse transport plans between discrete measures in loglinear time#768
[WIP] BSP-OT: Sparse transport plans between discrete measures in loglinear time#768dcoeurjo wants to merge 70 commits into
Conversation
Added 'TBA' section to the README.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #768 +/- ##
==========================================
- Coverage 96.87% 96.77% -0.11%
==========================================
Files 113 116 +3
Lines 23062 23180 +118
==========================================
+ Hits 22342 22432 +90
- Misses 720 748 +28 🚀 New features to boost your workflow:
|
| ) | ||
|
|
||
|
|
||
| def test_bsp_ot_torch_backend(): |
There was a problem hiding this comment.
add pytest skipif if torch not installed
rflamary
left a comment
There was a problem hiding this comment.
The PR is looking good thanks so much @dcoeurjo and @baptiste-genest . below are some comments about API.
| unbalanced | ||
| utils | ||
| weak | ||
| bsp |
There was a problem hiding this comment.
move this one up to stay alphabetical please
| between two large point clouds: shape morphing (and animated morphing) | ||
| and full color transfer (pixel permutation). | ||
|
|
||
| [?] Genest, B., Bonneel, N., Nivoliers, V., Coeurjolly, D. |
There was a problem hiding this comment.
the number ? is the same as in the end of the README file where you should add the reference also ;)
You should also have the same reference in the functions docstring with same number (and reference the algorithm in the paper from teh doc)
| # Load point clouds | ||
| # ---------------------------- | ||
| N = 100000 | ||
| A = sample_ball(N) |
There was a problem hiding this comment.
could you use X_s and X_t ? A and B are used for sample weights in other exmaples
| # Bijection computation | ||
| # ---------------------------------- | ||
|
|
||
| start = time.time() |
There was a problem hiding this comment.
| start = time.time() | |
| ot.tic() |
| cost, perm, _ = ot.bsp.compute_bspot_bijection(A, B, 64, 2) | ||
| print( | ||
| "Bijection computed between {} points, with cost {} in {}s".format( | ||
| N, cost, time.time() - start |
There was a problem hiding this comment.
| N, cost, time.time() - start | |
| N, ot.toq() |
return teh tiem wit better precision
| The transport cost of the final bijection. | ||
| plan : array-like, shape (n_samples,) | ||
| The final bijection, stored as a permutation (e.g. a list of numbers) such that X[i] is assigned to Y[plan[i]]. | ||
| plans : list of array |
There was a problem hiding this comment.
this should be array_like and size should be given (n_samples,n_plans)
| ------- | ||
| cost : float | ||
| The transport cost of the final bijection. | ||
| plan : array-like, shape (n_samples,) |
There was a problem hiding this comment.
call it perm, or perm_plan so that it is clear that it is a permutation, plan in POT is a OT plan (that can be sparse)
| return cost, plan, plans | ||
|
|
||
|
|
||
| def merge_bijections(X, Y, plans, lp_power=2): |
There was a problem hiding this comment.
| def merge_bijections(X, Y, plans, lp_power=2): | |
| def merge_bijections(X, Y, perms, p=2): |
| @@ -0,0 +1,3 @@ | |||
| [submodule "deps/eigen"] | |||
| path = deps/eigen | |||
| url = https://gitlab.com/libeigen/eigen.git | |||
There was a problem hiding this comment.
please fix the version/commit of eigen here. fdor instance with branch=5.0
| - Clean documentation (PR #787) | ||
| - Fix code coverage (PR #791) | ||
| - Fix test of the version of jax in `ot.backend` (PR #794) | ||
| - Reverting the openmp fix on macOS (PR #789) for macOS (PR #796) |
There was a problem hiding this comment.
| - Reverting the openmp fix on macOS (PR #789) for macOS (PR #796) |
Initial fork and PR. (wip)
Types of changes
Original paper
Motivation and context / Related issue
How has this been tested (if it applies)
PR checklist