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

Compare division by zero strategies #122

Open
stefanhannie opened this issue Mar 31, 2020 · 0 comments
Open

Compare division by zero strategies #122

stefanhannie opened this issue Mar 31, 2020 · 0 comments

Comments

@stefanhannie
Copy link
Contributor

Division by zero is unavoidable in a vectorized implementation of p_norm since zeros appear along the diagonal of the matrix. There are (at least) two strategies to overcome this:

  1. Catch the numpy division by zero errors and convert the output to nan.
  2. Add some small epsilon along the diagonal so that we no longer have zeros.

Strategy 1. is currently implemented.

with np.errstate(divide='ignore', invalid='ignore'): # handle division by 0

We should compare run-time differences and layout quality differences between the two strategies.

stefanhannie pushed a commit to stefanhannie/minorminer that referenced this issue Mar 31, 2020
boothby pushed a commit that referenced this issue Apr 1, 2020
* P_norm layout

A Kamada-Kawai-like algorithm with a variable p-norm distance function.
Now also passing dim, center, scale as kwargs to layout callables.

* Set p_norm as find_embedding default

* p_norm unit test

test_dimension also changed as the behavior is slightly different now.

* Minor changes

Layout.d changed to Layout.dim, documentation changes, split a test.

* Timeout changed to perf_counter

* Fixed typo added TODO #122
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

No branches or pull requests

1 participant