-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: main
Are you sure you want to change the base?
Add user guide #690
Conversation
for more information, see https://pre-commit.ci
…nto add/user_guide
There was a problem hiding this 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.
missing:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor changes
Please also add a general reference to examples / tutorials at the end. |
|
||
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. |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
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>`. |
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... 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. |
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THanks
No description provided.