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

Make get_unique_points more efficient #809

Closed
wants to merge 3 commits into from

Conversation

uri-granta
Copy link
Collaborator

@uri-granta uri-granta commented Jan 16, 2024

Related issue(s)/PRs: #781

Summary

Make get_unique_points more efficient and document its precise behaviour.

Fully backwards compatible: ish

The behaviour changes as we now use rounding to select points rather than a distance based loop. But the old behaviour was never fully documented, and the rounding approach should work fine for BatchTrustRegionBox.get_initialize_subspaces_mask which is the only place we currently use it.

PR checklist

  • The quality checks are all passing
  • The bug case / new feature is covered by tests
  • Any new features are well-documented (in docstrings or notebooks)

@uri-granta uri-granta marked this pull request as ready for review January 22, 2024 09:18
0.3,
tf.constant([True, True, False, True, False, True, False, True]),
),
(
tf.constant([[1.0], [2.0], [1.0], [3.0], [1.699999], [1.71], [3.300001], [3.29]]),
tf.constant([[1.0], [2.0], [1.0], [3.0], [2.10001], [2.1], [3.300001], [3.29]]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems problematic. The 2.10001 point is only 0.10001 away and well within the tolerance of 0.3 but is still marked as unique. I hadn't quite realised that the rounding boundary had such a big error effect.

@uri-granta
Copy link
Collaborator Author

Closing PR following offline discussion. Will create a separate PR for parallelising the existing greedy set cover algorithm.

@uri-granta uri-granta closed this Jan 23, 2024
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.

2 participants