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

Fixed "ValueError" in epsilon_schedule() when computing 0 sinkhorn distance. #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shallowcosmicjumper
Copy link

@shallowcosmicjumper shallowcosmicjumper commented Dec 30, 2023

fixed #34, #51, #74.

Cause

The roughly estimated maximum diameter is 0. By default, diameter of geomloss.SamplesLoss is None, an upper bound of the distance will be roughly estimated and used for generating the epsilon list. When the inputs are too close or the same, the estimated maximum diameter could be 0. Then p * np.log(diameter)* raises ValueError: Maximum allowed size exceeded for np.log(0) is -inf.

Solution

Set the argument blur as a lower bound for diameter. This still provides a valid eps_list for the further process.

Results

Using the case in #51
image

… Maximum allowed size exceeded" in epsilon_schedule() caused by np.log(0).
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.

ValueError: Maximum allowed size exceeded
1 participant