Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a tuto about sparse monge displacements #374

Merged
merged 12 commits into from
Jun 21, 2023

Conversation

pierreablin
Copy link
Contributor

This adds a tuto demoing sparse monge displacements with mixed costs.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -0,0 +1,271 @@
{
Copy link
Contributor

@marcocuturi marcocuturi Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #2.    output = sinkhorn.Sinkhorn()(linear_problem.LinearProblem(geom))

maybe worth jitting one solver for the entire NB, and reusing it?


Reply via ReviewNB

@@ -0,0 +1,271 @@
{
Copy link
Contributor

@marcocuturi marcocuturi Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #1.    transported = dual_potentials.transport(x)

both in this example and that below, it would be great to draw a fresh sample for x, to showcase the out of sample property of the estimator


Reply via ReviewNB

@@ -0,0 +1,271 @@
{
Copy link
Contributor

@marcocuturi marcocuturi Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k-overlap could be a bit nicer maybe? (less collapse)


Reply via ReviewNB

@@ -0,0 +1,271 @@
{
Copy link
Contributor

@marcocuturi marcocuturi Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most particles

"the same coordinate" -> since some points have more than one sometimes, "the" is a bit ambiguous


Reply via ReviewNB

@@ -0,0 +1,271 @@
{
Copy link
Contributor

@marcocuturi marcocuturi Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the "\tau" in "h_\tau" does not make much sense? maybe write directly \tau = ? or h = ?


Reply via ReviewNB

@codecov-commenter
Copy link

codecov-commenter commented Jun 20, 2023

Codecov Report

Merging #374 (6f73892) into main (31df701) will increase coverage by 0.05%.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #374      +/-   ##
==========================================
+ Coverage   88.43%   88.49%   +0.05%     
==========================================
  Files          51       52       +1     
  Lines        5605     5651      +46     
  Branches      836      837       +1     
==========================================
+ Hits         4957     5001      +44     
- Misses        529      530       +1     
- Partials      119      120       +1     

see 2 files with indirect coverage changes

Copy link
Contributor Author

All your comments have been taken into account. WDYT now?

@michalk8 michalk8 self-requested a review June 21, 2023 13:08
@@ -0,0 +1,428 @@
{
Copy link
Collaborator

@michalk8 michalk8 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The math doesn't completely render in the notebook.

In general, this notebook lacks some subsections, would add some.


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does the math not render here?

@@ -0,0 +1,428 @@
{
Copy link
Collaborator

@michalk8 michalk8 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #5.    from IPython import display

Remove unused import


Reply via ReviewNB

@@ -0,0 +1,428 @@
{
Copy link
Collaborator

@michalk8 michalk8 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #3.        if axe is None:

Why is this called "axe"? Would rename to "ax", as this is standard in matplotlib naming conventions.


Reply via ReviewNB

@@ -0,0 +1,428 @@
{
Copy link
Collaborator

@michalk8 michalk8 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a link to the Sinkhorn class as {class}~ott.solvers.linear.sinkhorn.Sinkhorn.

Would also add {class}problem <ott.problems.linear.linear_problem.LinearProblem>

and {class}entropic map <ott.problems.linear.potentials.EntropicMap>


Reply via ReviewNB

@@ -0,0 +1,428 @@
{
Copy link
Collaborator

@michalk8 michalk8 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a link to the DualPotentials class as {class}dual potentials <ott.problems.linear.potentials.DualPotentials>

Also please add a link to the transport method (using {meth}).


Reply via ReviewNB

@@ -0,0 +1,428 @@
{
Copy link
Collaborator

@michalk8 michalk8 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a link to the ElasticL1 cost.

The math doesn't render properly.


Reply via ReviewNB

@@ -0,0 +1,428 @@
{
Copy link
Collaborator

@michalk8 michalk8 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention the time complexity?


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that is a bit too much for this tutorial? I don't even know it myself

Copy link
Contributor

@marcocuturi marcocuturi Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's O(kd) :) i think it would make sense giving this complexity, and mention this starts having impact in higher dimensions (but not low d, as in this example), or removing the comment altogether because it's a bit too vague.

@michalk8
Copy link
Collaborator

There's a small typo in the notebook, that's why linter fails. After addressing the last few of my comments, we can merge!

@michalk8 michalk8 self-requested a review June 21, 2023 17:37
@michalk8 michalk8 merged commit 05c0afb into ott-jax:main Jun 21, 2023
michalk8 added a commit that referenced this pull request Jun 27, 2024
* update index

* init nb

* add paper

* jit solver

* add new source points

* rephrase

* fix h_tau

* add samples description

* fix from michal's comments

* fix math

* fix typo

* Update links to functions

---------

Co-authored-by: Michal Klein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants