Open
Conversation
* Add subset check with float error tolerance
Contributor
Author
|
@ttt-77 Do you mean to add a check like this? |
Collaborator
|
Yes. But can you refactor the code? Don't use three functions. |
* Use direct code instead of functions
Contributor
Author
|
@ttt-77 Is this better? |
ttt-77
reviewed
May 16, 2024
tests/test_limit_engine.py
Outdated
|
|
||
| aidb_res = set(aidb_res) | ||
| gt_res = set(gt_res) | ||
| return all(any( |
Collaborator
There was a problem hiding this comment.
You can create a variable and make it more readable.
* Expand function into loops
Contributor
Author
|
I expanded the outer two layers into loops to make it more readable, but I think retaining the innermost all() function won't affect readability much and simplifies the code. |
ttt-77
reviewed
May 18, 2024
| logger.info(f'There are {len(aidb_res)} elements in limit engine results ' | ||
| f'and {len(gt_res)} elements in ground truth results') | ||
| assert len(set(aidb_res) - set(gt_res)) == 0 | ||
| assert self._subset_check(aidb_res, gt_res) |
Collaborator
There was a problem hiding this comment.
Can you also add another check?
if len(aidb_res) < 100:
assert len(aidb_res) == len(gt_res)
else:
assert len(aidb_res) == 100
* Check the aidb result length
* Check the usage of proxy score by doing limit query on random and accurate proxy scores
Contributor
Author
Collaborator
|
Can you split the new commit into another PR? |
This reverts commit d04001d.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves issue #54. I assume the problem appears when there are floating point errors during serialization, so I added a function to check the subset relation with floating error tolerance.