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

expose epsilon parameter to allow precision to to be specified #275

Merged

Conversation

ChuckHastings
Copy link
Contributor

Per user request, this PR exposes the epsilon value that controls the precision where the Hungarian algorithm determines that a value has been reduced to sufficiently close to 0.

@ChuckHastings ChuckHastings self-assigned this Jun 14, 2021
@ChuckHastings ChuckHastings added 3 - Ready for Review breaking Breaking change enhancement New feature or request improvement Improvement / enhancement to an existing function and removed enhancement New feature or request labels Jun 14, 2021
Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@seunghwak seunghwak left a comment

Choose a reason for hiding this comment

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

I have one question, but besides the question, looks good to me.

const float epsilon{1e-6};
return ((w > -epsilon) && (w < epsilon));
bool __device__ near_zero<int32_t>(int32_t w, int32_t epsilon) {
return (w == 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why aren't we using epsilon here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For integer weights we can do an exact comparison to zero. For floating point values we need to do an approximate comparison.

@cjnolet
Copy link
Member

cjnolet commented Jun 15, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit bfaa6a0 into rapidsai:branch-21.08 Jun 15, 2021
rapids-bot bot pushed a commit to rapidsai/cugraph that referenced this pull request Jun 16, 2021
Closes #1645
Closes #1646 

Expose the precision parameter (epsilon in the Date/Nagi implementation) of the Hungarian algorithm to be controllable by the user.  Add support for rectangular matrices.

Will be enabled for CI after rapidsai/raft#275 is merged.

Authors:
  - Chuck Hastings (https://github.com/ChuckHastings)

Approvers:
  - Andrei Schaffer (https://github.com/aschaffer)
  - Brad Rees (https://github.com/BradReesWork)
  - Kumar Aatish (https://github.com/kaatish)

URL: #1673
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review breaking Breaking change cpp improvement Improvement / enhancement to an existing function
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants