Skip to content

Limit engine correctness check#178

Open
hjk1030 wants to merge 6 commits intoddkang:mainfrom
hjk1030:limit_engine_correctness_check
Open

Limit engine correctness check#178
hjk1030 wants to merge 6 commits intoddkang:mainfrom
hjk1030:limit_engine_correctness_check

Conversation

@hjk1030
Copy link
Contributor

@hjk1030 hjk1030 commented May 7, 2024

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.

* Add subset check with float error tolerance
@hjk1030
Copy link
Contributor Author

hjk1030 commented May 7, 2024

@ttt-77 Do you mean to add a check like this?

@ttt-77
Copy link
Collaborator

ttt-77 commented May 15, 2024

Yes. But can you refactor the code? Don't use three functions.

* Use direct code instead of functions
@hjk1030
Copy link
Contributor Author

hjk1030 commented May 15, 2024

@ttt-77 Is this better?


aidb_res = set(aidb_res)
gt_res = set(gt_res)
return all(any(
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can create a variable and make it more readable.

* Expand function into loops
@hjk1030
Copy link
Contributor Author

hjk1030 commented May 17, 2024

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.

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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you also add another check?
if len(aidb_res) < 100:
assert len(aidb_res) == len(gt_res)
else:
assert len(aidb_res) == 100

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, added this.

hjk1030 added 2 commits May 19, 2024 10:41
* Check the aidb result length
* Check the usage of proxy score by doing limit query on random and accurate proxy scores
@hjk1030
Copy link
Contributor Author

hjk1030 commented May 26, 2024

@ttt-77 Could you please review this? I added the test mentioned by issue #55 to this PR as well. Since no real index is provided for the jackson dataset, I compared the inference count when using the random proxy score and the accurate proxy score generated from the ground truth result.

@ttt-77
Copy link
Collaborator

ttt-77 commented May 27, 2024

Can you split the new commit into another PR?

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