-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added functions to a new mapping module * simplify ssnb function structure * SSNB example * removed numpy saves from example for prod * tests apart from the import exception catch * tests apart from the import exception catch * da class and tests * guessed PR number * removed unused import * PEP8 tab errors fix * skip ssnb test if no cvxpy * test and doc fixes * doc dependency + minor comment in ot __init__.py * PEP8 fixes * test typo fix * ssnb da backend test fix * moved joint ot mappings to the mapping module * better ssnb example + ssnb initilisation + small joint_ot_mapping tests * better ssnb example + ssnb initilisation + small joint_ot_mapping tests * removed unused dependency in example * no longer import mapping in __init__ + example thumbnail fix + made qcqp_constants function private * merge with POT main * fix barycentric projection factor omission in SSNB solver init * added modif in RELEASES.md * fix PR number in RELEASES.md * broadcast fix
- Loading branch information
1 parent
8a4a5a6
commit 57eda61
Showing
3 changed files
with
3 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
# Author: Eloi Tanguy <[email protected]> | ||
# License: MIT License | ||
|
||
# sphinx_gallery_thumbnail_number = 4 | ||
# sphinx_gallery_thumbnail_number = 3 | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
@@ -63,20 +63,6 @@ | |
plt.legend(loc='upper right') | ||
plt.show() | ||
|
||
# %% | ||
# Plotting image of barycentric projection (SSNB initialisation values) | ||
plt.clf() | ||
pi = ot.emd(ot.unif(n_fitting_samples), ot.unif(n_fitting_samples), ot.dist(Xs, Xt)) | ||
plt.scatter(Xs[:, 0], Xs[:, 1], c='dodgerblue', label='source') | ||
plt.scatter(Xt[:, 0], Xt[:, 1], c='red', label='target') | ||
bar_img = pi @ Xt | ||
for i in range(n_fitting_samples): | ||
plt.plot([Xs[i, 0], bar_img[i, 0]], [Xs[i, 1], bar_img[i, 1]], color='black', alpha=.5) | ||
plt.title('Images of in-data source samples by the barycentric map') | ||
plt.legend(loc='upper right') | ||
plt.axis('equal') | ||
plt.show() | ||
|
||
# %% | ||
# Fitting the Nearest Brenier Potential | ||
L = 3 # need L > 2 to allow the 2*y term, default is 1.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters