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

Feature/refactor relative epsilon #602

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

Conversation

michalk8
Copy link
Collaborator

@michalk8 michalk8 commented Nov 29, 2024

@marcocuturi could you please update the documentation?

closes #478

@michalk8 michalk8 added the bug Something isn't working label Nov 29, 2024
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.15%. Comparing base (561adbb) to head (86aa841).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/ott/geometry/geometry.py 92.85% 1 Missing and 1 partial ⚠️
src/ott/geometry/epsilon_scheduler.py 93.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #602      +/-   ##
==========================================
- Coverage   88.16%   88.15%   -0.01%     
==========================================
  Files          74       74              
  Lines        7764     7753      -11     
  Branches      544      542       -2     
==========================================
- Hits         6845     6835      -10     
+ Misses        778      777       -1     
  Partials      141      141              
Files with missing lines Coverage Δ
src/ott/geometry/grid.py 96.26% <100.00%> (+0.02%) ⬆️
src/ott/geometry/low_rank.py 96.73% <100.00%> (ø)
src/ott/geometry/pointcloud.py 95.43% <100.00%> (+0.02%) ⬆️
src/ott/initializers/quadratic/initializers.py 81.13% <100.00%> (ø)
src/ott/neural/methods/monge_gap.py 91.20% <ø> (ø)
src/ott/problems/quadratic/quadratic_problem.py 81.92% <ø> (ø)
src/ott/solvers/linear/discrete_barycenter.py 87.62% <100.00%> (ø)
src/ott/solvers/quadratic/gromov_wasserstein.py 88.98% <ø> (ø)
src/ott/geometry/epsilon_scheduler.py 95.83% <93.33%> (+1.38%) ⬆️
src/ott/geometry/geometry.py 94.44% <92.85%> (-0.02%) ⬇️

Copy link
Contributor

@marcocuturi marcocuturi left a comment

Choose a reason for hiding this comment

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

This is really nice.. and finally solves a longstanding ugly bug!!!

LGTM

import jax.numpy as jnp
import jax.tree_util as jtu

__all__ = ["Epsilon", "DEFAULT_SCALE"]

#: Scaling applied to statistic (mean/std) of cost to compute default epsilon.
DEFAULT_SCALE = 0.05
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should move DEFAULT_SCALE to geometry.py since this is where it's used? maybe also change its name? I could suggest DEFAULT_EPSILON_SCALE

**kwargs
}
return Epsilon(**kwargs)
def __repr__(self) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

cool!

cost_fn: a CostFn function between two points in dimension d.
x: Array of shape ``[n, d]``.
y: Array of shape ``[m, d]``. If :obj:`None`, use ``x``.
cost_fn: Cost function between two points in dimension :math:`d`.
batch_size: When ``None``, the cost matrix corresponding to that point cloud
Copy link
Contributor

Choose a reason for hiding this comment

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

:obj:None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Epsilon decay implementation is inconsistent with description
2 participants