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 user guide #690

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Add user guide #690

wants to merge 21 commits into from

Conversation

ArinaDanilina
Copy link
Collaborator

No description provided.

docs/user_guide.md Outdated Show resolved Hide resolved
docs/user_guide.md Outdated Show resolved Hide resolved
docs/user_guide.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@MUCDK MUCDK left a comment

Choose a reason for hiding this comment

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

also add more stuff, please.

@giovp giovp added this to the 0.4.0 milestone May 7, 2024
@giovp
Copy link
Member

giovp commented May 7, 2024

missing:

  • hyperparameters section
  • fill the table of the problems

@ArinaDanilina ArinaDanilina requested a review from MUCDK May 13, 2024 15:41
docs/user_guide.md Outdated Show resolved Hide resolved
docs/user_guide.md Outdated Show resolved Hide resolved
docs/user_guide.md Outdated Show resolved Hide resolved
docs/user_guide.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@MUCDK MUCDK left a comment

Choose a reason for hiding this comment

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

minor changes

@MUCDK
Copy link
Collaborator

MUCDK commented May 14, 2024

Please also add a general reference to examples / tutorials at the end.

@MUCDK MUCDK self-requested a review May 28, 2024 07:27

In their original formulation, OT algorithms don't scale to large datasets due to their high computational complexity. Moscot overcomes this limitation by allowing for the use of low-rank solvers. In each `solve` method we have the `rank` parameter, by default $-1$ -- the full rank.
Whenever possible, it's best to start with the full rank, but when needed, the rank should be set to a positive integer. The higher the rank, the better the full-rank approximation. Hence, one should start with a reasonable high rank, e.g. $5000$. Consecutively decrease the rank if needed due to memory constraints. Note that the scale of $\tau_a$ and $\tau_b$ changes whenever we are in the low-rank setting. While they should be still between $0$ and $1$, empirically they should be set in the range between $0.1$ and $0.5$. See {doc}`/notebooks/examples/solvers/100_linear_problems_basic` and {doc}`/notebooks/examples/solvers/300_quad_problems_basic` on how to use low-rank solutions.
Another option to use the full rank is to specify the `batch_size` parameter of the `solve` method. It determines the number of rows or columns of the cost matrix to materialize during the {term}`Sinkhorn` iterations. Larger values will require more memory and can be adjusted due to memory constraints as well.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we have this before low-rank? and then say, for linear problems we can do the batch_size, which reduces memory complexity (but slightly increase time complexity).

and then we motivate the low-rank: Whenever time complexity in a linear problem (e.g. TemporalProblem) should be reduced, or memory/time complexity in a quadratic (enumarte / link quadratic problems here) problem should be reduced , we use low-rank OT.


## Hyperparameters

Moscot problems' `solve` methods have the following parameters that can be set depending on the specific task:
Copy link
Collaborator

Choose a reason for hiding this comment

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

The solve method of moscot problems have a wide range of parameters. In the following, we discuss the most relevant ones:


Moscot problems' `solve` methods have the following parameters that can be set depending on the specific task:

- $\varepsilon$ - {term}`Entropic regularization`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

[...] This determines the stochasticity of the map. The higher epsilon, the more stochastic the map is.

Moscot problems' `solve` methods have the following parameters that can be set depending on the specific task:

- $\varepsilon$ - {term}`Entropic regularization`.
- $\tau_a$ and $\tau_b$ - Parameters in $(0, 1]$ that define how {term}`unbalanced <unbalanced OT problem>` is the problem on the source and target {term}`marginals`. If $1$, the problem is {term}`balanced <balanced OT problem>`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The lower tau, the more "unbalanced" the problem. Unbalancedness allows to automatically discard outliers, compensate for undesired distributional shifts, and model cell proliferation and apoptosis.


- $\varepsilon$ - {term}`Entropic regularization`.
- $\tau_a$ and $\tau_b$ - Parameters in $(0, 1]$ that define how {term}`unbalanced <unbalanced OT problem>` is the problem on the source and target {term}`marginals`. If $1$, the problem is {term}`balanced <balanced OT problem>`.
- $\alpha$ - Parameter in $(0, 1]$ that interpolates between the {term}`quadratic term` and the {term}`linear term`. $\alpha = 1$ corresponds to the pure {term}`Gromov-Wasserstein` problem while $\alpha \to 0$ corresponds to the pure {term}`linear problem`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

... $\alpha$ (only in problems building upon Fused Gromov-Wasserstein).....

- $\varepsilon$ - {term}`Entropic regularization`.
- $\tau_a$ and $\tau_b$ - Parameters in $(0, 1]$ that define how {term}`unbalanced <unbalanced OT problem>` is the problem on the source and target {term}`marginals`. If $1$, the problem is {term}`balanced <balanced OT problem>`.
- $\alpha$ - Parameter in $(0, 1]$ that interpolates between the {term}`quadratic term` and the {term}`linear term`. $\alpha = 1$ corresponds to the pure {term}`Gromov-Wasserstein` problem while $\alpha \to 0$ corresponds to the pure {term}`linear problem`.
- `batch_size` - Number of rows/columns of the cost matrix to materialize during the solver iterations. Larger value will require more memory.
Copy link
Collaborator

Choose a reason for hiding this comment

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

....See above the scalability

- `batch_size` - Number of rows/columns of the cost matrix to materialize during the solver iterations. Larger value will require more memory.
- `rank` - Rank of the {term}`low-rank OT` solver {cite}`scetbon:21b`. If $-1$, full-rank solver {cite}`peyre:2016` is used.

For more hyperparameters and their usage please refer to {doc}`/notebooks/examples/solvers/200_linear_problems_advanced` and {doc}`/notebooks/examples/solvers/400_quad_problems_advanced`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

you should also link to basic solve examples.

Copy link
Collaborator

@MUCDK MUCDK left a comment

Choose a reason for hiding this comment

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

THanks

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.

None yet

3 participants